#1
|
||
|
login help
this is my script:
[code:1:e45362f94f] <? if (isset($_POST['login'])) { $username = $_POST["user"]; $password = $_POST["pass"]; mysql_connect("localhost", "user", "pass") or die( "Unable to connect to database"); @mysql_select_db("db") or die( "Unable to select database"); $query="SELECT * FROM users WHERE user='$username' AND pass = '$password'"; $result=mysql_query($query); $username = $row['username']; $password = $row['password']; $id = $row['id']; if (mysql_num_rows==0) { echo ("The database contains no record of your user or your password is incorrect."); } else { setcookie("XingName", "$username"); setcookie("XingID", "$id"); mysql_close(); echo("<meta http-equiv=\"refresh\" content=\"0;URL=./?p=\">"); echo("Hello there $user"); }} else { echo("<form name=\"login\" action=\"\" method=\"post\">"); echo("<p>"); echo("<input name=\"user\" type=\"text\" id=\"user\">"); echo("</p>"); echo("<p>"); echo("<input name=\"pass\" type=\"password\" id=\"pass\" value=\"\">"); echo("</p>"); echo("<p>"); echo("<input type=\"submit\" name=\"login\" value=\"Submit\">"); echo("<input type=\"reset\" name=\"Reset\" value=\"Reset\">"); echo("</p>"); echo("</form>"); } ?> [/code:1:e45362f94f] it doesnt work though for some strange reason, anyone help? |
#2
|
||
|
your going $row['this']; but u need to run a while(){} loop ... :s
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't Login | fattybomb | Tech Support | 3 | 06-29-2009 06:29 PM |
i Cant login on DFB | mohamedRashid | Delta Force | 9 | 10-28-2008 11:34 AM |
LOGIN! | atholon | Feedback / Novahq.net Support | 2 | 04-11-2004 06:17 PM |
Can't login | JoJo | Tech Support | 0 | 04-21-2003 04:24 AM |
login name | XenoMorpH | Feedback / Novahq.net Support | 2 | 09-12-2002 05:12 AM |