Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Login and Search
#1
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?
Reply
#2
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!!!

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [help] Improve login script Montana" 1 1,738 03-18-2013, 12:59 PM
Last Post: Haxalot
  Don't need to login Strafeness 5 2,053 01-21-2012, 08:28 AM
Last Post: AceInfinity
  Creating a simple PHP/MySQL login script ndee 16 10,426 05-14-2011, 02:18 AM
Last Post: モrainee
  Simple secure login script. Frank Yates 2 1,742 03-08-2011, 10:11 AM
Last Post: lil-wayneee

Forum Jump:


Users browsing this thread: 1 Guest(s)