k21chrono Posted October 6, 2009 Share Posted October 6, 2009 Parse error: syntax error, unexpected T_ELSE in /home/content/m/e/s/mesick/html/students/05/php/checklogin.php on line 13 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <?php $myusername=$_POST['username']; $mypassword=$_POST['password']; if($myusername='********'&&$mypassword='********') header('Location:http://www.mesickonline.com/students/05/php/index.html'); else($myusername='********'&&$mypassword='********') header('Location:http://www.mesickonline.com/students/05/php/index.html'); ?> <body> </body> </html> Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/ Share on other sites More sharing options...
k21chrono Posted October 6, 2009 Author Share Posted October 6, 2009 P.S. this was posted by my friend....not me, he wants to use my Account for his web page class Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-931649 Share on other sites More sharing options...
Mchl Posted October 6, 2009 Share Posted October 6, 2009 Tell him to use code tags, and read PHP manual on if-else syntax. He needs curly braces if($myusername=='********'&&$mypassword='********') { header('Location:http://www.mesickonline.com/students/05/php/index.html'); } elseif($myusername=='********'&&$mypassword='********') { header('Location:http://www.mesickonline.com/students/05/php/index.html'); } Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-931651 Share on other sites More sharing options...
k21chrono Posted October 6, 2009 Author Share Posted October 6, 2009 Tell him to use code tags, and read PHP manual on if-else syntax. He needs curly braces if($myusername=='********'&&$mypassword='********') { header('Location:http://www.mesickonline.com/students/05/php/index.html'); } elseif($myusername=='********'&&$mypassword='********') { header('Location:http://www.mesickonline.com/students/05/php/index.html'); } He says thanks....lol Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-931655 Share on other sites More sharing options...
k21chrono Posted October 6, 2009 Author Share Posted October 6, 2009 ok now its still being a pain Parse error: syntax error, unexpected T_ELSE in /home/content/m/e/s/mesick/html/students/05/php/checklogin.php on line 13 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <?php $myusername=$_POST['username']; $mypassword=$_POST['password']; if($myusername='******'&&$mypassword='********') { header('Location:http://www.mesickonline.com/students/05/php/index.html'); } else($myusername='*******'&&$mypassword='********') { header('Location:http://www.mesickonline.com/students/05/php/index.html'); } ?> Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-931662 Share on other sites More sharing options...
Mchl Posted October 6, 2009 Share Posted October 6, 2009 Use tags around your code. 'else' was in line 13 in your previous code. There is a good chance you didn't save or upload your changes. This code doesn't make much sense anyway. It should be 'elseif' instead of 'else' and '==' instead of '='. Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-931668 Share on other sites More sharing options...
k21chrono Posted October 7, 2009 Author Share Posted October 7, 2009 Parse error: syntax error, unexpected '{' in /home/content/m/e/s/mesick/html/students/05/php/checklogin.php on line 15 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <?php $myusername=$_POST['username']; $mypassword=$_POST['password']; if($myusername=='*******'&&$mypassword='********') { header('Location:http://www.mesickonline.com/students/05/php/index.html');} else($myusername=='k**********h'&&$mypassword='*********') { header('Location:http://www.mesickonline.com/students/05/php/index.html');} elseif echo ("wronge user or pass") ?> Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-932482 Share on other sites More sharing options...
kickstart Posted October 7, 2009 Share Posted October 7, 2009 Hi An else should be an elseif else($myusername=='k**********h'&&$mypassword='*********') while the following elseif should be just an else. elseif echo ("wronge user or pass") All the best Keith ?> Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-932506 Share on other sites More sharing options...
k21chrono Posted October 9, 2009 Author Share Posted October 9, 2009 ok now i got no errors but instead of it taking my user or pass and saying heres the next page it just saying wrounge user and pass im trying to make a logg in for another site <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <?php $myusername=$_POST['username']; $mypassword=$_POST['password']; if($myusername=='*******'&&$mypassword='********') { header('Location:http://www.mesickonline.com/students/05/php/index.html');} elseif($myusername=='**********'&&$mypassword='*******') { header('Location:http://www.mesickonline.com/students/05/php/index.html');} else echo ("wronge user or pass") ?> <body> Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-933810 Share on other sites More sharing options...
kickstart Posted October 9, 2009 Share Posted October 9, 2009 Hi Couple of = signs missing if($myusername=='*******'&&$mypassword=='********') { header('Location:http://www.mesickonline.com/students/05/php/index.html');} elseif($myusername=='**********'&&$mypassword=='*******') All the best Keith Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-933813 Share on other sites More sharing options...
k21chrono Posted October 9, 2009 Author Share Posted October 9, 2009 fixed that now its still going to wronge user and pass <?php $myusername=$_POST['username']; $mypassword=$_POST['password']; if($myusername=='******'&&$mypassword=='*******') { header('Location:http://www.mesickonline.com/students/05/php/index.html');} elseif($myusername=='**********'&&$mypassword=='*******') { header('Location:http://www.mesickonline.com/students/05/php/index.html');} else echo ("wronge user or pass") ?> Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-933826 Share on other sites More sharing options...
kickstart Posted October 9, 2009 Share Posted October 9, 2009 Hi Echo out the userid and password to check they are the ones you expect:- <?php $myusername=$_POST['username']; $mypassword=$_POST['password']; if($myusername=='******'&&$mypassword=='*******') { header('Location:http://www.mesickonline.com/students/05/php/index.html'); } elseif($myusername=='**********'&&$mypassword=='*******') { header('Location:http://www.mesickonline.com/students/05/php/index.html'); } else { echo ("wronge user or pass *".$myusername."*".$mypassword."*") } ?> All the best Keith Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-933834 Share on other sites More sharing options...
k21chrono Posted October 9, 2009 Author Share Posted October 9, 2009 wronge user or pass *** that is what its echoing now Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-933838 Share on other sites More sharing options...
kickstart Posted October 9, 2009 Share Posted October 9, 2009 Hi That suggests the userid and password haven't got to the script. Have you sent them by GET instead of POST? Are the field names defiantly username and password? All the best Keith Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-933853 Share on other sites More sharing options...
k21chrono Posted October 9, 2009 Author Share Posted October 9, 2009 thanks ill try that monday that has been making me mad all week Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-933912 Share on other sites More sharing options...
k21chrono Posted October 14, 2009 Author Share Posted October 14, 2009 omfg Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/e/s/mesick/html/students/05/php/checklogin.php: in /home/content/m/e/s/mesick/html/students/05/php/checklogin.php on line 14 <code> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; if($myusername=='fishandben'&&$mypassword=='holycrap') { header('Location:mesickonline.com/students/05/php/index.html');} elseif($myusername=='k21chrono'&&$mypassword=='bloody01') { header('Location:http:mesickonline.com/students/05/php/index.html');} else echo ("wronge user or pass *" . $myusername . "*" . $mypassword . "*") ?> </body> </html> </code> Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-936840 Share on other sites More sharing options...
kickstart Posted October 14, 2009 Share Posted October 14, 2009 Hi That suggests that you have tried to do a redirect to another page after you have already output something (even a blank line). All the best Keith Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-936848 Share on other sites More sharing options...
k21chrono Posted October 14, 2009 Author Share Posted October 14, 2009 its all fixed thanks guys Link to comment https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/#findComment-936855 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.