Here's a portion of my updated page.

On one page I have a form. When you click a button it will switch to my updated.php page.

What I would like it to do is go back to the page the person was on.

Here's the code I have now and it doesn't do anything

$rsUpdate = mysql_query($update);
if ($rsUpdate)
{
echo '<head><meta http-equiv="refresh" content="1; url= $_SERVER['http_referrer'];"></head>Calculations complete<br />Reloading in 1 seconds or click to go to the <a href="../index.php">Main Page</a>';
} mysql_close();
?>
?>

Doing this, will result in a 404 error with the url as .......days/$_SERVER[http_referrer];

Any idea on how after my update database code to automatically send the user back to the page they were on but refreshed?

    its a problem with your sting, and you should note http_referrer, may not be set as it comes from the browser.

    			echo '<head><meta http-equiv="refresh" content="1; url="'.$_SERVER['http_referrer'].'"></head>Calculations complete<br />Reloading in 1 seconds or click to go to the <a href="../index.php">Main Page</a>'; 
    
    
      dagon;10934337 wrote:

      its a problem with your sting, and you should note http_referrer, may not be set as it comes from the browser.

      			echo '<head><meta http-equiv="refresh" content="1; url="'.$_SERVER['http_referrer'].'"></head>Calculations complete<br />Reloading in 1 seconds or click to go to the <a href="../index.php">Main Page</a>'; 
      
      

      WHen I use that code. it throws this error:

      Notice: Undefined index: http_referrer in /home/computer/public_html/pool/days/calc_updated.php on line 48

        That's because it's not "http_referrer" it's "HTTP_REFERER". Look it up.

          No joy on that.

          Puts an error on the page.

          Notice: Undefined index: Alkalinity in /home/computer/public_html/pool/days/calc_updated.php on line 32
          Notice: Undefined index: Alk_Needs in /home/computer/public_html/pool/days/calc_updated.php on line 33
          Notice: Undefined index: Calcium in /home/computer/public_html/pool/days/calc_updated.php on line 34
          Notice: Undefined index: Cal_Needs in /home/computer/public_html/pool/days/calc_updated.php on line 35
          Notice: Undefined index: R0871_drops in /home/computer/public_html/pool/days/calc_updated.php on line 36
          Notice: Undefined index: R0003_drops in /home/computer/public_html/pool/days/calc_updated.php on line 37
          Notice: Undefined index: Chl_Needs in /home/computer/public_html/pool/days/calc_updated.php on line 38
          Notice: Undefined index: Chl_Change in /home/computer/public_html/pool/days/calc_updated.php on line 39
          Notice: Undefined index: Chl_Add in /home/computer/public_html/pool/days/calc_updated.php on line 40
          Notice: Undefined index: HTTP_REFERER in /home/computer/public_html/pool/days/calc_updated.php on line 48
          Calculations complete
          Reloading in 1 seconds or click to go to the Main Page
          

          It will update the database but throws the message keep refreshing.

            thats a notice on a new page, and its not an error it's a notice, look it up in the php docs.

              Write a Reply...