elite_prodigy Posted April 9, 2008 Share Posted April 9, 2008 Parse error: syntax error, unexpected T_STRING in /home/expose/public_html/exposeyourschool.co.cc/acp_design_proj/login.php on line 2 <?php session_start(); if(isset($_SESSION[username]) && isset($_SESSION[id])){ echo $null_var1; } else{ header("location:login.php"); } ?> Link to comment https://forums.phpfreaks.com/topic/100373-solved-unexpected-t_string/ Share on other sites More sharing options...
p2grace Posted April 9, 2008 Share Posted April 9, 2008 Try this: <?php session_start(); if(isset($_SESSION['username']) && isset($_SESSION['id'])){ echo $null_var1; } else{ header("location:login.php"); } ?> Link to comment https://forums.phpfreaks.com/topic/100373-solved-unexpected-t_string/#findComment-513276 Share on other sites More sharing options...
elite_prodigy Posted April 9, 2008 Author Share Posted April 9, 2008 Same response. Thanks, but that didn't help.... Link to comment https://forums.phpfreaks.com/topic/100373-solved-unexpected-t_string/#findComment-513293 Share on other sites More sharing options...
p2grace Posted April 9, 2008 Share Posted April 9, 2008 Then I'm guessing the error is somewhere else. Post more code above and below what you've given us, and show exactly what line number it's dying on. Link to comment https://forums.phpfreaks.com/topic/100373-solved-unexpected-t_string/#findComment-513296 Share on other sites More sharing options...
elite_prodigy Posted April 9, 2008 Author Share Posted April 9, 2008 That is the entire code for that page. The error is on line 2. Link to comment https://forums.phpfreaks.com/topic/100373-solved-unexpected-t_string/#findComment-513298 Share on other sites More sharing options...
rhodesa Posted April 9, 2008 Share Posted April 9, 2008 Yeah, the problem is on login.php, and this looks like the code to forward you to login.php. What are the first 5 lines in login.php? Link to comment https://forums.phpfreaks.com/topic/100373-solved-unexpected-t_string/#findComment-513300 Share on other sites More sharing options...
elite_prodigy Posted April 9, 2008 Author Share Posted April 9, 2008 <?php mysql_connect('localhost, '******', '******')or die(mysql_error()."<br /><br /><h3>An error occurred whille attempting to log you in</h3>"); mysql_select_db('expose_expose') or die("cannot select DB"); // username and password sent from form $username=$_POST['user']; $password=$_POST['pass']; $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); Link to comment https://forums.phpfreaks.com/topic/100373-solved-unexpected-t_string/#findComment-513310 Share on other sites More sharing options...
p2grace Posted April 9, 2008 Share Posted April 9, 2008 There it is: <?php mysql_connect('localhost', '******', '******')or die(mysql_error()."<br /><br /><h3>An error occurred whille attempting to log you in</h3>"); mysql_select_db('expose_expose') or die("cannot select DB"); // username and password sent from form $username=$_POST['user']; $password=$_POST['pass']; $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); Need the single quote after localhost Link to comment https://forums.phpfreaks.com/topic/100373-solved-unexpected-t_string/#findComment-513311 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.