Page 1 of 1

session problem

Posted: Sat Jun 09, 2007 4:23 pm
by pph
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


this is my code

Code: Select all

session_start(); 



$age1=$_POST['age'];
$age2=$_POST['age2'];
$sex=$_POST['gender1'];
$findcountry=$_POST['country'];

session_register("age1");

session_register("age2");
session_register("sex");
session_register("findcountry");

echo echo $_SESSION['age1']."<br>";
echo echo $_SESSION['age2']."<br>";
echo echo $_SESSION['sex']."<br>";
echo echo $_SESSION['findcountry']."<br>";
this session having no out put. why is that


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sat Jun 09, 2007 4:30 pm
by feyd
session_register() is not to be used anymore, it's deprecated.

What is the purpose of the double echo calls?

Posted: Sat Jun 09, 2007 4:52 pm
by pph
What is the purpose of the double echo calls?[quote] its a mistake any way how to solve this problem.
if session_register ,is not working any more what i have to do?
actually iam try to code page navigation. thats the why i need to keep every time age1,age2,sex and country varibles for my sql syntax
$sql = "select * from penfriends where age>='$age1' and age<='$age2' and gender='$sex' and country='$findcountry' ORDER BY lname DESC LIMIT " . $Limit . ";";

please help me to solve this problem .thx