Re: $HTTP_Referer

From: Date: Thu, 06 Nov 2003 18:54:47 +0000
Subject: Re: $HTTP_Referer
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-168761@lists.php.net to get a copy of this message
--- Josephin <j.tauschinger@fincas-exclusivas.com> wrote: > am a newbie as of yesterday. Welcome! > Can't figure out how to get the $HTTP_Referer (own domain) of the page > entering my form (html), convert it into a variable which is later > passed on to my formmailer.php for the $subject variable. > > xy.html ------->form.html------>formmailer.php > > want the $HTTP_Referer or HTTP_URI, file only, (of xy.html) > -->to be forwarded to form.html, > -->to be converted in a variable, > -->which is passed on to formmailer.php, which will use it as "subject". Well, in PHP, you can use $_SERVER['HTTP_REFERER']. However, unless your Web server is configured to treat form.html as a PHP script (which I seriously doubt is the case), you will not have access to this information at that point. So, you can't do what you're describing wihout the original POST request (xy.html -> form.html) being to a PHP resource rather than an HTML one. Hope that helps. Chris ===== My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp

« previous php.general (#168761) next »