Posted by Peter on 11/19/18 11:47
Hi NC, I tried the $_SERVER['SCRIPT_URI'] but it returns NULL. E.g I
have an html page with a form like this:
<form action="refer.php" method="post">
<p>First Name</br><input type="text" name="name" size="20"
maxlength="40"/></p>
<p><input type="submit" name="submit" value="Send Message"/></p>
</form>
And then this is my php code:
<?php
$refer = $_SERVER['SCRIPT_URI'];
echo $refer;
?>
But it comes back blank.
I would like it to return the full html URL like the HTTP_REFERER does
but seems that it is not to be relied on.
I think it will be best to use a hidden form on each page that contains
the URL and the just get this.... for reliability.
It's just that I have to then edit each page individually to add the
hidden value.
Thanks a lot though!
Pete.
Navigation:
[Reply to this message]
|