Eg: [noparse]www.maindomain.com[/noparse] contains this file:
<html>
<head></head>
<body marginheight="0" marginwidth="0">
<iframe src="http://www.serverdomain.com/index.php" width="100%" height="100%" frameborder="0" transparency marginheight="0" marginwidth="0">
</iframe>
</body>
</html>
And the second domain, “serverdomain.com”, contains another file: index.php
If I search in the $_SERVER variables, the first time index.php loads, i can get the main “caller” file from the HTTP_REFERER var, but in the following reloads, this value changes, and I can’t get who is the caller domain (in this example, it should be “maindomain.com”.
I could do that parsing a session var, but that doesnt help if the session runs out.
Any quiz?
HTTP_REFERER is notoriously unsafe to use for the purposes of tracking.
What exactly are you trying to do (and why is it being done across two servers?)
Up to now, i installed the same CMS in every website I own, but now I want to install the CMS only once, and refer the others to that one. Of course, using different datasources for each domain, and using different Usernames and passwords.
I’d personally use a key-and-session system to do it, but that’s me…
Using HTTP_REFERER is very unsafe and unpredictable - if a browser has referers disabled, your code will flop.
I think it’s the only option left. But, when session expires, what should the file do? without any session, it would not know from where it was refered.
if there is no session, have Javascript tell the parent to reload.
As always, you are RIGHT! Thank you in advance!!