bleured27 Posted July 19, 2012 Share Posted July 19, 2012 i got the follow error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /Applications/XAMPP/xamppfiles/htdocs/sessions/guardien.php on line 30 in this script all sesions worK ?php ini_set('display_errors', 'On'); error_reporting(E_ALL); session_start(); if ($_SESSION["loggedin"] == null): header("location:home.php"); endif; $host = 'localhost'; // Server Host Name $user = 'root'; // Server User Name $password = ''; // Server Password $db = 'test'; // Your Database $link = mysql_connect($host,$user,$password) or die('Error in Server information'); mysql_select_db($db,$link) or die('Can not Select Databasse'); $query = "select * from userinfo where username='{$_SESSION['theuser']}' and password='{$_SESSION['pass']}'"; $res = mysql_query($query) or die(mysql_error()); $rows = mysql_num_rows($res); if($rows!=1) { header("location:'home.php'); } elseif($_SESSION['gm']=="gm") { include'gmbar.php'; } else { $boyoboy="1"; } else{ header("location:'home.php'); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/265958-gaurded-page/ Share on other sites More sharing options...
cpd Posted July 19, 2012 Share Posted July 19, 2012 header("location: 'home.php'); is your issue. Clear syntax error and in more than one place. Seems like you copied and pasted the code. Quote Link to comment https://forums.phpfreaks.com/topic/265958-gaurded-page/#findComment-1362815 Share on other sites More sharing options...
xyph Posted July 19, 2012 Share Posted July 19, 2012 We aren't here to debug minor errors like this. Please actually check your code, accuracy is absolutely necessary for application development. It's pointless to continue to learn until you can manage to solve basic syntax errors like this on your own. I'd suggest using a development environment that supports syntax highlighting. Notepad++ is a lightweight, simple one for Windows. It will help you debug these issues. Quote Link to comment https://forums.phpfreaks.com/topic/265958-gaurded-page/#findComment-1362825 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.