I am trying to make it so that when someone clicks a link on my site, they will be redirected to an out.php page and then taken to the site the link was aimed at. I wanted to do this so I could display a goodbye message to the user.
I have been looking for a way to do this for a while now but I cannot find any solutions to my problem.
If anyone has any ideas on how I could do this, I would love to know.
Thanks
Something like this should do the trick:
<?php
$url = urldecode($_GET['target']);
echo 'Thank you for visiting, you will be taken to ... in 5 seconds';
echo "<script> setTimeout('window.location = \"$url\";', 5000);</script>";
echo '<a target="_blank" href="out.php?target=' . urlencode($targetUrl) . '">Click</a>';
You could try this
<a href="out.php">The LINK</a>
when you click on link it will take you to out.php
where you will display "thank you".
Make sure that out.php
is in same folder as your html doc else you will have to specify the path where your out.php
lies.