On my website, I have a button which when clicked displays a feedback form in a popup window.
I need to pass the url in the PARENT window to a hidden field in the feedback form.
I tried:
<?php $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>
<input type="hidden" id="addressBar" name="addressBar" value= "<?php echo $url ?>"/>
The problem with the above code is that it passes the url of the current window, in my case, the url of the feedback popup window.
How do I pass the url of the parent window to that hidden field?
Many thanks for your help
You can try
$_SERVER['HTTP_REFERER']instead ofREQUEST_URI(it gives you current uri)but keep in mind that it’s not reliable…
Another way could be something like this …
and then in popup.php just check if
refquery string is set and retrieve its value.