proctk Posted September 6, 2007 Share Posted September 6, 2007 Hi My tring to send a variable through a url then once that variable will be called to display the message. After the message is displayed I want want the user redirected to a new page after a time delay, any help is excellent /*Log Error*/ $page = $_SERVER['REQUEST_URI']; $referring_page = $_SERVER['HTTP_REFERER']; $user_id = $_SESSION['user_id']; $userIP = $_SERVER['REMOTE_ADDR']; $query_error_logging = ("INSERT INTO error_tracking (page, referring_page, error_msg, user_id, ip_address, error_date)VALUES('$page', '$referring_page', '$msg', '$user_id', '$userIP', now())"); $log_error = mysql_query($query_error_logging)or die("SQL Error: $query_error_logging<br>" . mysql_error()); header("Location: $url?msg=$msg&id=null"); header('refresh: 2; url=familyProfile.php'); exit(); } Link to comment https://forums.phpfreaks.com/topic/68158-refresh-problem/ Share on other sites More sharing options...
proctk Posted September 6, 2007 Author Share Posted September 6, 2007 code that displays the message <?php $msg = (isset($_GET['msg']) AND $_GET['msg']<> "") ? urldecode($_GET['msg']) : ''; if ($msg <> "") { if (get_magic_quotes_gpc()) { $msg = stripslashes($msg); } echo "<div id='alertMessage'><p style='margin-left:40px;'>$msg</p></div>"; } ?> Link to comment https://forums.phpfreaks.com/topic/68158-refresh-problem/#findComment-342660 Share on other sites More sharing options...
trq Posted September 6, 2007 Share Posted September 6, 2007 Your first call to header() will redirect to another page to display your message. You will need to do the next redirect from there. As it stands, your script will never get to the second header() call. Link to comment https://forums.phpfreaks.com/topic/68158-refresh-problem/#findComment-342661 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.