hi
i am new to php.i want the login page userid to get displayed in the next page as"welcome userid".....please do tell me the syntax for passing the userid to next page.....
lydia21
9
Junior Poster
Recommended Answers
Jump to Postuse a session variable to get the userid from the previous page. for example:
//page1///////////
if (*succesful entry)
{
session_start();
$_SESSION('userid')=*your userid;
header("Location:page2.php")
exit();
}
///////////////////////page2///////////
session_start();
echo "Welcome,";
echo $_SESSION('user_id');
////////////////////
Jump to PostHey dude,you forgot your session_start()!
All 8 Replies
Shobhit
-3
Newbie Poster
ryan_vietnow
13
Posting Pro
lydia21
9
Junior Poster
lydia21
9
Junior Poster
black_ip82
0
Newbie Poster
ryan_vietnow
13
Posting Pro
black_ip82
0
Newbie Poster
black_ip82
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.