|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-05-01 13:38 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 16:00:01 2025 UTC |
Description: ------------ i have installed xampp and created a my login form which i wrote a program to access the user name and password after compile i got this bug or error message :Parse error: syntax error, unexpected $end in C Kindly solve this problem ....I am unable to execute this ....you can send the solution to my mail id mentioned ... Raghavendra Reproduce code: --------------- <? session_start()?> <html> <head> <title>login </title> </head> <body> <h2>login</h2> <? $links="<a href='main.php'>click to </a><br><br><a href='logout.php'>click</a>"; if($user&&$pass){ if($logged_in_user==$user){ echo $user.",you are already logged in.<br><br>"; echo $links; exit; } $db=mysql_connect("localhost"); mysql_select_db("raghu",$db); $result=mysql_query("SELECT * FROM userlist WHERE name ='".$user."' AND password= PASSWORD('".$pass."')"); if(!$result){ echo "sorry, there has ben hitch"; exit; } if(mysql_num_rows($result)>0){ $logged_in_user = $user; session_register("logged_in_user"); echo "welcome,".$logged_in_user.".<br><br>"; echo $links; exit; } else { echo "invalid login ,please try again<br><br>"; } ?> <form method=post action="login.php"> Your username: <input name="user" type=text maxlength=20 size=20> <br> your password: <input name="pass" type=password maxlength=10 size=10> <br> <input type=submit value="login"> </body> </html> Expected result: ---------------- Login user and password ...check for the user name and password if exist,it should allow the user.If not it should say new user please register...