Hi all,
I have a web page with a POST form which action points to the same script using $PHP_SELF. So at the beginning of the page I evaluate the POST arguments.
Now, because this page can be accessed from a different page as well and I want to pass arguments via GET, the first thing it does is evaluate the GET argument.
So if a GET argument called PROJECTID exists, then populates the data in that form with the Project data, otherwise, it checks if any of the POST variables have been set (ie: form submitted) and acts accordingly.
My problem is that, once I get to the page using the GET argument, the action in the FORM using PHP_SELF also passes the GET argument and therefore it does not act as if the form was submitted (hope you can understand this, it's a bit of a mess, sorry)
I thought to myself: "OK PHP_SELF is passing the GET argument because the current page has received it" so I tried adding the following:
if ($pos = strpos($_SERVER['PHP_SELF'], '?')) {
$ME = substr($_SERVER['PHP_SELF'], 1, $pos);
}
else {
$ME = $_SERVER['PHP_SELF'];
}
And changing the Action of the POST form to point to $ME with no success. Any help as to how I can accomplish this? I am happy to expand if something (or all of it) is not quite clear.
Thanks for taking the time to read all this.