hi, i have set up a membership system for a website.
eveything that updates i.e. add news, update news, edit user profile etc are all verified on a single php page called updated.php
it works by the following:
$last = getenv("HTTP_REFERER"); //get last page
and then using an if statement to check the last page with the page url i.e. if the last page was addnews
if ( $last == "http://localhost/addnews.php
then update the database
it all works fine. although i wanted to use the $_SERVER["DOCUMENT_ROOT"] function opposed to the lanky url that i would have to change when its uploaded. currently if i set it on my hard drive (localhost)
if ($last == $_SERVER["DOCUMENT_ROOT"].
they will never equate to the same thing becoz
getenv("HTTP_REFERER") returns 'http://localhost/addnews.php'
$_SERVER["DOCUMENT_ROOT"] returns 'c:\ webroot' and therefore
will never equal the same thing.
will this work when uploaded on to a webserver or am i going around it the wrong way, or should i just leave the lanky link and change it to what ever it should be when it is uploaded?
thanks in advance.