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

Reply via email to