Lucian Posted January 8, 2007 Share Posted January 8, 2007 I'm having some problems with this PHP code. It gives me an error saying: Parse error: syntax error, unexpected $end in /home/zendurl/public_html/lucian/php/login.php on line 27Can someone please tell me how to fix this problem. Below is the PHP that i have.<?php$data = file("log.txt"); for($x = 0; $x < count($data); $x++) { $parts = explode('|',$data[$x]); $name_check = strpos($parts[0],$_POST['username']); if($name_check == true) { $name = 1; }else{ $name = 0; } $pass_check = strpos($parts[1],$_POST['password']); if($pass_check == true) { $pass = 1; }else{ $pass = 0; } if($name == 1 && $pass == 1) { echo "hello"; }?> Link to comment https://forums.phpfreaks.com/topic/33301-login-php/ Share on other sites More sharing options...
fert Posted January 8, 2007 Share Posted January 8, 2007 you forgot a } Link to comment https://forums.phpfreaks.com/topic/33301-login-php/#findComment-155562 Share on other sites More sharing options...
cshireman Posted January 8, 2007 Share Posted January 8, 2007 Yes, you forgot the } to close the for loop. Add one at the end of the file and it will work fine.Chris Link to comment https://forums.phpfreaks.com/topic/33301-login-php/#findComment-155613 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.