I've been twisting my mind trying to figure out how to get the real URL. I have a page at namezero which requires you to have a frame_banner at the bottom of the page, thus making it impossible to enter direct URL-adresses. E.g. http://www.metusmortuus.net and http://www.metusmortuus.net/samples.html will both end up at the same page, namely the page that this virtual domain is pointing to. (I hope you understand this)
What I need is to find the actual URL that was typed into the 'location'-box. Then I would be able to simply redirect my visitors to that page manually. (Yikes, this was hard to describe, but I hope you get the picture)
None of the predefined variables listed in phpinfo() worked (incl. request_uri and http_referrer), so I guess this is a long shot...
I understand what you mean, and I think I could do it with perl (cgi), but I'm not that versed in PHP to do tricks like that.
July 10th, 2000, 09:04 AM
July 10th, 2000, 03:27 PM
Like I said, none of the variables listed in phpinfo() works... incl. http_host, phpself etc. etc... The HTML file itself resides on a different server, and what I need is the virtual URL... I really don't think it's possible :-(
July 10th, 2000, 05:24 PM
I've got a similar situation myself, but haven't addressed the problem yet.
I'll try to come up with something later this week, and if it works, I'll post a solution here...
Have Fun !
July 11th, 2000, 10:28 AM
Try REQUEST_URI. I this should be the URI that the visitor typed in.
July 11th, 2000, 12:02 PM
To explain this a little further. My page is loaded inside a frame (classic URL cloaking) and the frame belongs to the providers of the Domain-forwarding-provider. So request_url would work in the frame (which I don't have access to), but not in my page (which reflects the server that the file is actually stored at)
That's why this seems hopeless, but the URL remains in the location window (where you type in URL's) so I'm wondering if it's possible to get it in any other way. Like I said 2 times allready, none of the variables in phpinfo() works (which includes all suggestions so far)
July 11th, 2000, 12:10 PM
OKay, well here's a thought, if you are working with a framed document and you want to preven access to a specific frame etc, why not try checking http referrer, look for whatever url you are after.. parse_url() can be set to readily check the referrer, for the specific, if it doesn't match bounce them with a header() call to whatever url you want them to enter from.
in short, for using http referrer you grab their referrer, and then point them to the main page "if" the referrer doesn't match that page.. etc.
Low Cost Hosting and Web Development.
July 11th, 2000, 06:31 PM
if (top.frames.length != 0)
That will reload your page in the window, and you wont have the frames...
Hopes thats helps...