session problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pph
Forum Newbie
Posts: 2
Joined: Sat Jun 09, 2007 3:59 pm

session problem

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

session_register() is not to be used anymore, it's deprecated.

What is the purpose of the double echo calls?
pph
Forum Newbie
Posts: 2
Joined: Sat Jun 09, 2007 3:59 pm

Post 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
Post Reply