Okay I got this to work with the $_GET functions but I want to try and get it to work with Sessions
ALright on one page I have this :
$hurl = '/JutsuSite/JutsuDB/view.php';
$root = $_SERVER["DOCUMENT_ROOT"].$hurl;
$link =$_GET['link'];
switch($link) {
case 'konoha':
$_SESSION['cat']='Name';
$_SESSION['key']='Konoha';
include($root);
break;
case 'suna':
$_SESSION['cat']='Name';
$_SESSION['key']='Suna';
include($root);
break;
case 'all':
$_SESSION['cat']= FALSE;
$_SESSION['key']= FALSE;
include($root);
break;
default:
include('news.htm');
}
Based on what the 'link' sends to the Script I want it to set certain Values to 'cat' and 'key' Session
then it should go to here:
$s_key=$_SESSION['key'];
$s_cat=$_SESSION['cat'];
echo $s_key;
if(isset($_SESSION['key']))
{
$query = "SELECT * FROM $table_name WHERE $s_cat=\"$s_key\"";
$result= mysql_query($query,$connection);
echo Ss_key;
}
else
{
$query = "SELECT * FROM $table_name ORDER BY Name";
$result= mysql_query($query,$connection);
echo Ss_key;
}
and based on what $_sessions had in it it should order the data by the passed variables
But I dont know why its not working
I dont get any errors but it doesn't sort the data by the passed variables it just displays everythingin the database. So I am assumung that its not passing what I am trying to set in the other script.
Can anyone find out what wrong?