View Single Post
Join Date: Oct 2006
Posts: 876
Reputation: ardav will become famous soon enough ardav will become famous soon enough 
Solved Threads: 116
ardav's Avatar
ardav ardav is offline Offline
Practically a Posting Shark

Re: Execute PHP file in the background from html page

 
0
  #10
Jan 9th, 2009
Just write this at the bottom of your php files (like mentioned previously):

  1. <?php header("Location:htmlcode.html");exit; ?>

or for more generic return code (it will return you to the previous page):

  1. <?php header("Location:{$_SERVER['HTTP_REFERER']}");exit; ?>
You MUST ensure that no text (error messages or echoed php or any HTML) is output to screen before the header function is called or you will get an error.
Last edited by ardav; Jan 9th, 2009 at 7:50 pm.
Reply With Quote