perezf Posted September 10, 2006 Share Posted September 10, 2006 :-\what is wrong with the following codei am getting an error[quote]Parse error: parse error, unexpected T_BOOLEAN_AND in /hsphere/local/home/way2fr3s/2fr3sh.com/userlogin.php on line 15[/quote][code]<?php $username = "admin";$password = "password";$user = $_POST['user'];$pass = $_POST['pass'];if($user == $username) && if($pass == $password) {//line 15echo "Welcome to our site $user.";} else { ?><form name="form1" method="post" action=""> <p> UserName:<br> <input type="text" name="user"> <br> Password:<br> <input type="text" name="pass"> <br> <input type="submit" name="Submit" value="Submit"></p></form><?php } ?>[/code] Quote Link to comment Share on other sites More sharing options...
tomfmason Posted September 10, 2006 Share Posted September 10, 2006 try this[code=php:0]if ($user == $username && $pass == $password) {[/code]Hope this helps,Tom Quote Link to comment Share on other sites More sharing options...
ahmed17 Posted September 10, 2006 Share Posted September 10, 2006 if($user == $username) && if($pass == $password) using $$ for not tie two if statment by using for tie its contents if ($user == $username && $pass == $password) Quote Link to comment Share on other sites More sharing options...
perezf Posted September 10, 2006 Author Share Posted September 10, 2006 it works thank you to all Quote Link to comment Share on other sites More sharing options...
perezf Posted September 10, 2006 Author Share Posted September 10, 2006 i could i read the username and password from a database Quote Link to comment Share on other sites More sharing options...
perezf Posted September 10, 2006 Author Share Posted September 10, 2006 how could i i meant to say Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.