Porkie Posted September 23, 2009 Share Posted September 23, 2009 ideas on how if i link is clicked to say 'www.google.co.uk' from my website, a page is shown before the user can see google webpage. is the way off doing this ? cheers Quote Link to comment https://forums.phpfreaks.com/topic/175272-question-on-php-ability/ Share on other sites More sharing options...
Alex Posted September 23, 2009 Share Posted September 23, 2009 You should be more descriptive. Quote Link to comment https://forums.phpfreaks.com/topic/175272-question-on-php-ability/#findComment-923757 Share on other sites More sharing options...
Porkie Posted September 23, 2009 Author Share Posted September 23, 2009 basically i want to be able to create an intercept between the link being pressed and the user going to google. Is it possible ? If so how would i go about it? Quote Link to comment https://forums.phpfreaks.com/topic/175272-question-on-php-ability/#findComment-923760 Share on other sites More sharing options...
Garethp Posted September 23, 2009 Share Posted September 23, 2009 Change the link to something like redirt.php?link=www.google.co.uk and have redirect.php be your inbetween page Quote Link to comment https://forums.phpfreaks.com/topic/175272-question-on-php-ability/#findComment-923762 Share on other sites More sharing options...
nuttycoder Posted September 23, 2009 Share Posted September 23, 2009 you could create a link like <a href="ref.php?code=google">www.google.co.uk</a> then on ref.php it gets the url requested $code = $_GET['code']; //$code contains google then you could do a switch statement to check for various links you may have then do what ever your going to do then either direct the page to the link using a header or a text link,button. Quote Link to comment https://forums.phpfreaks.com/topic/175272-question-on-php-ability/#findComment-923764 Share on other sites More sharing options...
DavidAM Posted September 23, 2009 Share Posted September 23, 2009 You would have to change the link on your page to go to your intercept page, pass in the desired url and do a refresh on a timeout or something; on your main page the link would be something like this: <A href=myIntercept.php?dest=www.google.co.uk>Google Roundabout</A> the myIntercept.php would have to do something along these lines (this is just an outline, you'll have to flesh it out) <?php // Get the user's ultimate destination $dest = $_GET['dest']; // Now show them my page ?> <HTML> <HEAD> <TITLE>INTERCEPTED!!!</TITLE> <!-- Here's where we forward them on to their destination --> <META http-equiv="refresh" content="10;url=http://<?php echo $dest;?>"> </HEAD> <BODY> <H1>INTERCEPTED!!!</H1> <P>I just wanted to see your pretty face before you ran off to <?php echo $dest; ?></P> </BODY> </HTML> In the META refresh tag, the number 10 in the example above is the number of seconds to delay before refreshing the page. The url specifies the page that the refresh will open. You can't use a header('Location ...') call here if you want to display anything to the user because the header redirect will happen before the page gets loaded. If you just want to track the links and not show something, you can use the header after you have done all of your tracking code. Quote Link to comment https://forums.phpfreaks.com/topic/175272-question-on-php-ability/#findComment-923769 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.