Pavlos1316 Posted June 5, 2008 Share Posted June 5, 2008 Hi I am trying to sent a welcome echo when enterimg members page. Either if i put echo before or after the header I get nothing displayed. Is there something else I should do? Thanks Quote Link to comment Share on other sites More sharing options...
craygo Posted June 5, 2008 Share Posted June 5, 2008 little code would be nice. Quote Link to comment Share on other sites More sharing options...
discomatt Posted June 5, 2008 Share Posted June 5, 2008 <?php echo 'Hello World'; ?> Quote Link to comment Share on other sites More sharing options...
Pavlos1316 Posted June 5, 2008 Author Share Posted June 5, 2008 if(mysql_num_rows($result)>0){ //Login Successful //Regenerate session ID to //prevent session fixation attacks session_regenerate_id(); $member=mysql_fetch_assoc($result); $_SESSION['SESS_ID']=$member['ID']; //Write session to disc session_write_close(); header ("location: member.php"); echo "<p> </p><p> </p><center><font color=#FFFF00><font size=36><font weight=bold>Welcome $Username to our members area.</font></font></font></center>"; exit(); Quote Link to comment Share on other sites More sharing options...
prcollin Posted June 5, 2008 Share Posted June 5, 2008 if(mysql_num_rows($result)>0){ //Login Successful //Regenerate session ID to //prevent session fixation attacks session_regenerate_id(); $member=mysql_fetch_assoc($result); $_SESSION['SESS_ID']=$member['ID']; //Write session to disc session_write_close(); header ("location: member.php"); echo "<p> </p><p> </p><center><font color=#FFFF00><font size=36><font weight=bold>Welcome $Username to our members area.</font></font></font></center>"; exit(); show us the whole code? Quote Link to comment Share on other sites More sharing options...
craygo Posted June 5, 2008 Share Posted June 5, 2008 as soon as you put in the header(location) it will go directly to that page, you will not see your message. If you want to see it use a META refresh instead. Ray Quote Link to comment Share on other sites More sharing options...
sasa Posted June 5, 2008 Share Posted June 5, 2008 change header ("location: member.php"); to header('Refresh: 5; url=http://www.yoursite.com/member.php'); Quote Link to comment Share on other sites More sharing options...
Pavlos1316 Posted June 5, 2008 Author Share Posted June 5, 2008 I know how to view msg before the member.php page loads. But I want to display the msg in that page. Quote Link to comment Share on other sites More sharing options...
sasa Posted June 5, 2008 Share Posted June 5, 2008 ok change lines header ("location: member.php"); echo "<p> </p><p> </p><center><font color=#FFFF00><font size=36><font weight=bold>Welcome $Username to our members area.</font></font></font></center>"; to echo "<p> </p><p> </p><center><font color=#FFFF00><font size=36><font weight=bold>Welcome $Username to our members area.</font></font></font></center>"; include ("member.php"); Quote Link to comment Share on other sites More sharing options...
craygo Posted June 5, 2008 Share Posted June 5, 2008 You got the id in a session, just query the table with the id and put the message on the next page. Either that or you would need to store the username in the session and put the welcome message on the next page and use the session variable instead of $Username. Ray Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.