note 41440 added to function.parse-str
| From: | mattsoft at mattsoft dot net | Date: | Sat, 10 Apr 2004 00:53:32 +0000 |
| Subject: | note 41440 added to function.parse-str | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67934@lists.php.net to get a copy of this message | ||
I think this code might come in handy for some people. my site loads pages thru a single index.php
file like this ./?page=home . for my login page, I wanted to send the user back to the page they
were on before they clicked the button to go to the logon page. when the logon page is loaded and
displayed, this code gets the page name from the referer header so it can add it to the form to be
sent with the login info. sounds complex, but is pretty simple.
if($frompage==""){
$a=parse_url(getenv("HTTP_REFERER"));
parse_str($a['query'],$a);
$frompage=$a['page'];
}
----
Manual Page -- http://www.php.net/manual/en/function.parse-str.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41440
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41440&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41440&report=yes
Search -- http://master.php.net/manage/user-notes.php