Support Forums

Full Version: Simple Login and Search
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I took a script Master of the Universe gave me to connect to a database ad display information to make these two tools.

Login
http://www.mediafire.com/file/jiwmmntlynh/Login.zip

Search
http://www.mediafire.com/file/5gd2dz0mzmz/Search.zip

Although my login does work I'm confused. I figured when you registered it would be saved to login.sql, however it is not. Where is it saved to?
In the registered.php you have a error.
After you definde $sql add this
It will execute the SQL command.
PHP Code:
$query mysql_query($sql) or die (mysql_error()); 

And in the script I've gave you, add this after the while function. (loggedin.php)
PHP Code:
mysql_free_result($query); // it will free up the memory 

Then the line (loggedin.php)
PHP Code:
if(!$query mysql_query($sql)) {
// to
if(!$query mysql_query(mysql_real_escape_string($sql))) {
// mysql_real_escape_string will clean $username and $password from malicious input 

To keep the connection, you'll need to set cookie or an session
http://php.net/manual/en/features.cookies.php
http://php.net/manual/en/features.sessions.php

Now to search...
Perfect, you did a best query... I was expecting to see "WHERE" but you used "LIKE", nice!!!