it works for me - to only problem is if you're transferring data from one page to the other via the form. You'll need some other why of doing it (sessions, cookies, use GET, other)
-----Original Message----- From: Don [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 12:43 PM To: Martin Towell; php Subject: Re: [PHP] Can I set the value of variable depending on when the page is loaded? Would that solve my probem with the BACK button? ----- Original Message ----- From: "Martin Towell" <[EMAIL PROTECTED]> To: "'Don'" <[EMAIL PROTECTED]>; "php" <[EMAIL PROTECTED]> Sent: Thursday, June 13, 2002 10:38 PM Subject: RE: [PHP] Can I set the value of variable depending on when the page is loaded? > instead of using js to redirect, could you use header("location:"); ? > > -----Original Message----- > From: Don [mailto:[EMAIL PROTECTED]] > 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 > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php