i define a variable on one page, that includes another page.
on the included page i want to have a if function with that variable.
i tried it with $GET.... buts that didnt work...!!!///
Moderator: General Moderators
Code: Select all
//PAGE 1
session_start();
$myVar = 'Hello World';
$_SESSION['MY_VAR'] = $myVar;
//Page 2
session_start();
echo $_SESSION['MY_VAR'];Code: Select all
function namere ($session) {
$result = mysql_query("SELECT Authorisation FROM AdminUser
WHERE UserSession = '".$session."'") or mysql_error();
$username = mysql_fetch_array($result);
if($username['Authorisation']<=$_SESSION['page']){
echo "Do what you wanna";
}
elseif($username['Authorisation']>$_SESSION['page']){
echo "Not authorised";
}Code: Select all
error_reporting(E_ALL);
session_start();
include("connect.inc.php");
include("usermanagment.inc.php");
namere(session_id());
$_SESSION['page'] = 1;