Getting Domain name From an redirected page

Hi ALL!

I'm not a php coder but I need a script for this situation:

xyz.com redirects to abc.com/index.html, then this redirects to abc.com/index.php

But the URL in the address bar stays xyz.com the whole time, so I want a text field of my form in index.php to show xyz.com as referrer how do I do it through php

And I can’t make changes to xyz.com as I don’t host a site there, it’s just forwarding to abc.com/index.html

This is the script i have now:

<?php $server=$_SERVER['HTTP_REFERER']; echo $server; ?>

This script keys in abc.com/index.html in the textfield. How do i get xyz.com?

PLEASE HELP

If you have your base page on abc.com as HTML and it redirects to another page,
then abc.com becomes the referring page.

HTML has no way of passing that value unless you do so inside of Javascript.

You could write a Javascript routine that stores the referring page into a hidden form field.
Then, your index.PHP page could read that hidden form field using $_POST[] array and use
it as needed.

Note, this would mean that you would have to alter the index.html page to use a form which
would only contain the one hidden field where the page would be stored.

Not sure if that is what you are looking for. But, hope that helps…

Sponsor our Newsletter | Privacy Policy | Terms of Service