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 Link to comment https://forums.phpfreaks.com/topic/108887-echo-in-a-new-page/ Share on other sites More sharing options...
craygo Posted June 5, 2008 Share Posted June 5, 2008 little code would be nice. Link to comment https://forums.phpfreaks.com/topic/108887-echo-in-a-new-page/#findComment-558593 Share on other sites More sharing options...
discomatt Posted June 5, 2008 Share Posted June 5, 2008 <?php echo 'Hello World'; ?> Link to comment https://forums.phpfreaks.com/topic/108887-echo-in-a-new-page/#findComment-558612 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(); Link to comment https://forums.phpfreaks.com/topic/108887-echo-in-a-new-page/#findComment-558625 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? Link to comment https://forums.phpfreaks.com/topic/108887-echo-in-a-new-page/#findComment-558628 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 Link to comment https://forums.phpfreaks.com/topic/108887-echo-in-a-new-page/#findComment-558630 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'); Link to comment https://forums.phpfreaks.com/topic/108887-echo-in-a-new-page/#findComment-558631 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. Link to comment https://forums.phpfreaks.com/topic/108887-echo-in-a-new-page/#findComment-558640 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"); Link to comment https://forums.phpfreaks.com/topic/108887-echo-in-a-new-page/#findComment-558653 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 Link to comment https://forums.phpfreaks.com/topic/108887-echo-in-a-new-page/#findComment-558655 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.