Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ad Frame (Like Hotmail)

Status
Not open for further replies.

pgaec

Programmer
Aug 4, 2003
161
0
0
AU
Hi all

This is what I want to do: Whenever someone clicks on a external link on my website, i want the external link open in a new page that has a frameset. the top frame should display banner ads whereas the bottom frame should display the external link the user clicked.

i got a javascript on my webpage that automatcially changes all the external urls to

website>/external.php?siteUrl=<<original url>>

so a link to becomes

website>/external.php?siteUrl=http://www.google.com.au


and my external.php looks like

Code:
<?
if ($_GET['siteUrl']) {
	$filename = $_GET['siteUrl'];
} else {
	die ("no filename selected");	
}	
if (substr($filename,0,4) != 'http') {
	$filename = "[URL unfurl="true"]http://".$filename;[/URL]
}
?>
<HTML>
<head>
  <TITLE><?echo $filename ?></TITLE>
</head>
<frameset rows="120,1*" border="0" frameborder="0" framespacing="0">
	<frame src="adbrite.php" scrollbar="no">
	<frame src="<?echo $filename ?>">
</frameset>
</HTML>

it works fine. but if the external url contains ? or & (request parameters) then it does not work.

I want to do something like this:


any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top