MDanz Posted July 30, 2009 Share Posted July 30, 2009 <?php $username $_POST['username']; $password $_POST['password']; if($username&$password) { $connect = mysql_connect ("localhost","Master","password")or die("Couldn't Connect"); mysql_select_db("Login")or die("Couldn't Connect"); } else { die ("Please enter a username and password"); } ?> Parse error: syntax error, unexpected T_VARIABLE in /home/ustackc1/public_html/Login.php on line 2 Can anyone help me out i tried different variations and checked but i keep on getting this error when i press the login button. Link to comment https://forums.phpfreaks.com/topic/168212-parse-error-help/ Share on other sites More sharing options...
Philip Posted July 30, 2009 Share Posted July 30, 2009 You don't have equal signs...... that's whats throwing the parse errors. $username = $_POST['username']; $password = $_POST['password']; Link to comment https://forums.phpfreaks.com/topic/168212-parse-error-help/#findComment-887232 Share on other sites More sharing options...
MDanz Posted July 30, 2009 Author Share Posted July 30, 2009 honestly i don't understand what you mean... do you mean it $username should be different to the one in brackets? Link to comment https://forums.phpfreaks.com/topic/168212-parse-error-help/#findComment-887236 Share on other sites More sharing options...
lonewolf217 Posted July 30, 2009 Share Posted July 30, 2009 you are trying to assign a value to the variable. therefore you need to use the equal sign as an operator, not just list the two variables see his example Link to comment https://forums.phpfreaks.com/topic/168212-parse-error-help/#findComment-887239 Share on other sites More sharing options...
MDanz Posted July 30, 2009 Author Share Posted July 30, 2009 thx!! Link to comment https://forums.phpfreaks.com/topic/168212-parse-error-help/#findComment-887243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.