Jump to content

gaurded page


bleured27

Recommended Posts

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');
}


?>

Link to comment
https://forums.phpfreaks.com/topic/265958-gaurded-page/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/265958-gaurded-page/#findComment-1362825
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.