Forum Moderators: coopster
I have a site I am developing that when a certain link is clicked it goes to a script called out.php
What this does is display a message saying, 'thanks for visiting' and in the background it loads some tracking code in an 'img src' tag then 2 seconds later redirects to a predifined url ie.
out.php?trackcode=http://www.trackingcode.com&url=http://www.redirecthere.com
This works fine but I have seen a site that does exactly the same as the above except you never see the 'out' script page, and when you click on a link it looks like a seemless redirect to the 'url=' yet still manages to load the trackcode.
I have spent all weekend trying to figure this out, but it has me flummoxed.
Anyone have any ideas how this might be done?
Thanks
Chris
<?phpsetcookie("some_name","some_value",strtotime("2020-01-01"),"",".yourdomain.com");
header('HTTP/1.1 301 Moved Permanently');
header("Location: [example.com...]?>
The cookies aren't set in the traditional sense, they are set from an url which I have been loading in an image source tag ie.
<img src="http://www.trackurl.com/?order=1" width="1" height="1">
So what I have been doing, from my out.php script, is load this code first then using a 2 second time delayed header redirect go to the url, while the page says 'thanks for visiting'.
I would like to cut this page out and make all this seem invisible to the user. I am not sure how the other site I have seen has done this?
Cheers anyway
Chris
it's not cute, but it would work
OR, i'm pretty sure you can get javascript to load the image onClick(), wait a sec for it to load, then do the redirect?
still not cute, but it would work
OR, add your image to their destination page (fopen their destination url, append the html for your image to the end and the correct base href, then echo it)
<script type='text/javascript'>function DoRedirect()
{
window.location = 'http://www.example.com/';
}</script>
<img onload='javascript:DoRedirect()' src="http://www.trackurl.com/?order=1" width="1" height="1">