GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Javascript / PHP help needed ... (https://gfy.com/showthread.php?t=458618)

4Pics 04-21-2005 06:07 PM

Javascript / PHP help needed ...
 
Is there any way via window.open to have it pass the referring url?

It seems to do it on some IE's and always in Firefox. So far I think my only way is to do a window.open and then have a gateway page but I didn't want to do that if I didnt have to.

Thanks

Varius 04-21-2005 06:10 PM

If I"m understanding you right, couldn't you just append the current url to the new page you are opening, as a parameter?

4Pics 04-21-2005 06:16 PM

The page I am opening wants to make sure its coming from www.domain.com but if you use window.open that is blank for some reason in most browsers, firefox seems to pass it and some pc's here do too.

Varius 04-21-2005 06:20 PM

If you rely on the browser, I think you are out of luck....

"The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted."

Thus, I think the only 100% method would be to pass it as a parameter...it does mean the page being opened would have to accept and read that parameter though.

Varius 04-21-2005 06:22 PM

Note: If you pass it as a param, it loses any real use security-wise...as anyone could pass whatever info they want.

You'd have to use some encryption.

4Pics 04-21-2005 06:24 PM

thanks :) That's what I got from a few google searches, just wanted to make sure there wasn't some other hack to make it work.

mortenb 04-21-2005 06:37 PM

you could do it with a pretty simple javascript..

put this in the popup window..

Code:


if(window.opener.document.location.href!="http://www.yourdomain.com/somepage.html") {
    alert("bahh.. you didn't come here from the correct page");
}



All times are GMT -7. The time now is 12:40 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123