Re: Page name for form submit: REQUEST_URI or SCRIPT_NAME

From: Date: Sun, 28 Dec 2008 16:57:24 +0000
Subject: Re: Page name for form submit: REQUEST_URI or SCRIPT_NAME
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-285146@lists.php.net to get a copy of this message
At 7:31 PM +0200 12/27/08, Dotan Cohen wrote:
Is there a compelling reason to use either REQUEST_URI or SCRIPT_NAME in the action of a form that I want to submit to the same URL that it came from (the script parses whether or not there is a Submit to know if it should display the form or the results). I need a portable solution, that is why I am not hardcoding it. Also, the users _may_ save the form to their hard drives, so simply leaving the action blank will not do. I know that REQUEST_URI includes the ?variable=value string and that SCRIPT_NAME does not. This form does not depend upon get variables, so this should never be an issue, but I ask here anyway to know if there are other differences that I did not account for. Thanks! -- Dotan Cohen
Dotan: Maybe this is too simple, but what I do is to leave the form attribute action="" blank. My understanding (may be wrong) is that forms always submit to themselves unless directed to do so otherwise. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#285146) next »