Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ptown

macrumors newbie
Original poster
Jan 14, 2004
21
0
I have say, 100 links on a page and when any of the links are clicked,
a redirect page pops up that tells the viewer they are leaving the website and are no longer under the protection of the orignal site. The viewer then has a choice to continue or cancel.

I want to create one redirect page instead of 100. So I need something that will take the url link the viewer has choosen, and place it into the redirect page, and link them to that url when they choose to continue.

Any suggestions would be great. I am guessing it would be PHP script. But I have never used it.

Thanks in advance
 
I was wondering about this as well. I want to make a similar page to frame external sites, similar to what about.com does at their site. But I don't want to have to make a frameset for each page. Perhaps it uses a referer to direct them to the correct page. A similar use of this type of page is intermidate adversitements that load and make you watch them before you go to the next page in the site.
 
GovornorPhatt said:
I was wondering about this as well. I want to make a similar page to fram external sites, similar to what about.com does at their site. But I don't want to have to make a frameset for each page. Perhaps it uses a referer to direct them to the correct page. A similar use of this type of page is intermidate adversitements that load and make you watch them before you go to the next page in the site.


What do yo mean by "fram external sites"? And do you think this could be accomplished by a Javascript.
 
The about.com page is pretty simple to do in PHP, something like the following would work (I haven't worked with frames for years so you'll have to excuse any HTML mistakes, i'm just copying from the about.com page)

Code:
<html>
<head><title>Offsite page</title></head>

<FRAMESET ROWS="82,*" FRAMEBORDER=1>
     <FRAME NAME="sitetop" SRC="yourheader.html">
     <FRAME NAME="sitebottom" SRC="<?php print $_GET["url"]; ?>"
</FRAMESET>

<noframes>
Click here (etc)
</noframes>
</html>

Place that in a file called redirect.php and then when you want to link to an external site you link to redirect.php?url=http://www.apple.com

NB. Generally using an input (the url) without doing any security checking on it is a very bad idea but i'll leave that bit as an exercise to the reader ;)

The original question is really just a variation of this, for example

Code:
<html>
<head><title>Offsite page</title></head>
<body>
You are leaving mysite.com.

Do you wish to <a href="<?PHP print $_GET["url"]; ?>">Continue</a> or 
<a href="<?PHP print $_GET["r"]; ?>">Return</a> to mysite.com

</body>
</html>

In this case you would add a second parameter to the url, so it would be

redirect.php?url=http://www.apple.com&r=/index.html

You could use the referer instead of passing the "r" parameter but the referer is not guaranteed to work so i tend to prefer passing it manually.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.