By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,704 Members | 1,404 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,704 IT Pros & Developers. It's quick & easy.

Help , i cann't Read session value in another page

P: 104
Hi Friends
i need help in sessions
im passing variables between pages using sessions
this is the main page thats mean the home page
the main page have table to show messages for users , it have also the site style

<table wisth='100%' height='500' border='1' cellpadding='0' callspacing='0'>

and i have another page named functions.php that setting the session, it have this code

function showmsg($msg){

the third page is login.php , this code

case "login":
showmessage("Error<br>Supply Empty Fields");

if(($username!='abdoelmasry')||($password!='$amiab do95245ra!@')){
showmessage("Not Valid Login Info");

echo "
<form name='login' action='login.php?do=login' method='post'>
<input type='textbox' name='username' value='username'><br>
<input type='password' name='password'><br>
<input type='submit' value=' login '></form>

if the username or password empty it will send the message (Error<br>Supply Empty Fields)

to function showmsg() to set the session variable the send header to main page
that will write the session value

but i cannot read session from another page
it can be readed in functions.php

i think the function showmsg() not setting global session

i need help to set session from showmsg function , then read session in another page

i hope i could explain

Please read the Posting Guidelines before you post in this forum! Especially the part about enclosing your code with tags

Jan 21 '07 #1
Share this Question
Share on Google+
3 Replies

P: 33

I think you need to use $_SESSION['variable_name'] in your code. And you need to give the command session_start on each of the page, where you needed the session variable

Please refer

Subash :)
Jan 21 '07 #2

P: 104
Thank you Much subash

but what is the changes between



could You Help ?
Jan 22 '07 #3

P: 104
Sorry moderator
Will Not Repead Again

Abdo Elmasry
Feb 10 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.