/    Sign up×
Community /Pin to ProfileBookmark

Outgoing link script with iframe not working?

I made an outgoing link script that will open the link in an iframe but unfortunately it doesn’t work. I know it will work but obviosuly something is wrong.

It works by prepending LinkToSite.com with outgoing.php?[url]http://LINKTOSITE.com[/url]

Here is the code I made so far:

<?php

$redirect = $_SERVER[‘QUERY_STRING’].”;

?>

[code=php]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Frameset//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd”>;
<html>
<head>
<title>Frameset Example Title (Replace this section with your own title)</title>
</head>

<frameset rows=”200,*” frameborder=”0″ border=”0″ framespacing=”0″>
<frame name=”menu” src=”http://www.domain.com/i/frame.html” marginheight=”0″ marginwidth=”0″ scrolling=”auto” noresize>
<frame name=”content” src=”<?php
echo $_SERVER[‘QUERY_STRING’];
?>” marginheight=”0″ marginwidth=”0″ scrolling=”auto” noresize>

<noframes>
<body>
<img src=”http://www.omain.com/wp-content/uploads/2013/06/logo4.png” /> <p></p>
You are now being redirected to a merchant website where you can buy the product, view prices and learn more about the product. <p></p> Please wait one moment. <p></p>
If you aren’t redirected within 5 seconds <a href=”<?php
echo $_SERVER[‘QUERY_STRING’];
?>” onClick=”_gaq.push([‘_trackEvent’, ‘Merchant Redirect’, ‘Clicked’, ‘Clicking on redirect link’]);”>Click Here</a> to go directly to merchant site.
<p></p>
<a href=”<?php
echo $_SERVER[‘QUERY_STRING’];
?>” onClick=”_gaq.push([‘_trackEvent’, ‘Merchant Redirect’, ‘Clicked’, ‘Clicking on redirect button’]);” class=”button”>Continue to your product without waiting </a> <SCRIPT LANGUAGE=”JavaScript”>
setTimeout(“location.href ='<?php echo $redirect ?>'”,3500);
</script>
</noframes>

</frameset>
</html>
[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NoEffinWayAug 01.2013 — I have no idea what your end goal is but this loads in the frame. It's ugly but works and with a little effort could be cleaned up.

[code=html]
<!DOCTYPE html>
<html>
<head>
<title>Frameset Example Title (Replace this section with your own title)</title>
</head>
<body>
<!--What is this for?-->
<!--<iframe name="menu" src="http://www.domain.com/i/frame.html" marginheight="0" marginwidth="0" scrolling="auto" noresize>-->
<iframe name="content" src="<?php
echo $_SERVER['QUERY_STRING'];
?>" marginheight="0" marginwidth="0" scrolling="auto" noresize>

<img src="http://www.omain.com/wp-content/uploads/2013/06/logo4.png" /> <p></p>
You are now being redirected to a merchant website where you can buy the product, view prices and learn more about the product. <p></p> Please wait one moment. <p></p>
If you aren't redirected within 5 seconds <a href="<?php
echo $_SERVER['QUERY_STRING'];
?>" onClick="_gaq.push(['_trackEvent', 'Merchant Redirect', 'Clicked', 'Clicking on redirect link']);">Click Here</a> to go directly to merchant site.
<p></p>
<a href="<?php
echo $_SERVER['QUERY_STRING'];
?>" onClick="_gaq.push(['_trackEvent', 'Merchant Redirect', 'Clicked', 'Clicking on redirect button']);" class="button">Continue to your product without waiting </a> <SCRIPT LANGUAGE="JavaScript">
setTimeout("location.href ='<?php echo $redirect ?>'",3500);
</script></iframe>
</body>
</html>
[/code]
×

Success!

Help @Nerdygeek spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...