giannis Posted September 24, 2010 Share Posted September 24, 2010 Hello, I get the following error: Parse error: syntax error, unexpected T_ELSE in /home/home/public_html/test/change_password.php on line 50 The code is: else if (empty($password1) || empty($password2)) { echo $empty_fields_message; } Link to comment https://forums.phpfreaks.com/topic/214300-else-if-error/ Share on other sites More sharing options...
kickstart Posted September 24, 2010 Share Posted September 24, 2010 Hi Suspect the error is on the previous line. All the best Keith Link to comment https://forums.phpfreaks.com/topic/214300-else-if-error/#findComment-1115189 Share on other sites More sharing options...
chintansshah Posted September 24, 2010 Share Posted September 24, 2010 can you providde php code here? Link to comment https://forums.phpfreaks.com/topic/214300-else-if-error/#findComment-1115191 Share on other sites More sharing options...
giannis Posted September 24, 2010 Author Share Posted September 24, 2010 The only php code before that line is: <?php include "connect.php"; session_start(); session_register("session"); $empty_fields_message = "<p>Click <a class=\"two\" href=\"javascript:history.go(-1)\">here</a> to go back and complete all the fields in the form.</p>Click <a class=\"two\" href=\"javascript:history.go(-1)\">here</a> to go back"; $password1 = $_POST['password1']; $password2 = $_POST['password2']; if(!isset($session['userid'])){ echo "<center><font face='Verdana' size='2' color=red>Sorry, Please login and use this page </font></center>"; exit; } ?> Link to comment https://forums.phpfreaks.com/topic/214300-else-if-error/#findComment-1115193 Share on other sites More sharing options...
kickstart Posted September 24, 2010 Share Posted September 24, 2010 Hi Err, the error says line 50, and that is a lot less than 50 lines All the best Keith Link to comment https://forums.phpfreaks.com/topic/214300-else-if-error/#findComment-1115196 Share on other sites More sharing options...
giannis Posted September 24, 2010 Author Share Posted September 24, 2010 Yes, it's less than 50 lines since I didn't paste the html Link to comment https://forums.phpfreaks.com/topic/214300-else-if-error/#findComment-1115197 Share on other sites More sharing options...
chintansshah Posted September 24, 2010 Share Posted September 24, 2010 Sorry but, I am strugling to understand code. Link to comment https://forums.phpfreaks.com/topic/214300-else-if-error/#findComment-1115198 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.