RE: [PHP] Can I set the value of variable depending on when the p age is loaded?

From: Date: Fri, 14 Jun 2002 02:38:05 +0000
Subject: RE: [PHP] Can I set the value of variable depending on when the p age is loaded?
Groups: php.general 
Request: Send a blank email to php-general+get-102125@lists.php.net to get a copy of this message
instead of using js to redirect, could you use header("location:"); ? -----Original Message----- From: Don [mailto:mail4donpro@rogers.com] Sent: Friday, June 14, 2002 12:36 PM To: php Subject: [PHP] Can I set the value of variable depending on when the page is loaded? Hi, I have a an HTML page containing a form used to search my website. The form has a drop-down menu with two choices. When the submit button is clicked, I call a PHP page which look at the value of the drop down menu selection and redirects to the appropriate form handler. Basically, my PHP file creates a form called 'searchform' and creates it dynamically based on the vale of my drop down menu field passed from the calling page. I just use the following JavaScript to redirect: echo "<script language=\"JavaScript\">\n"; echo "setTimeout('document.searchform.submit()',0);\n"; echo "</script>\n"; My problem is, when the user clicks the BACK button on their browser, it will just redirect back to the search results page. I'd like it to take them back to the original page. I'm thinking that if I could reset the value of the drop-down menu field, I can just use: echo "<form name=\"searchform\" action=\"javascript: history.back();\">\n"; But, how can I tell where the user is coming from? I've seen these types of searches before so maybe someone can clue me in? Thanks, Don

« previous php.general (#102125) next »