Leao Posted May 31, 2014 Share Posted May 31, 2014 Hi, I want to send the following variable using the $_GET function: www.example.com/index.php?id=https://twitter.com/intent/tweet?url=http%3A//youtu.be/gvckPiuN9ug&text=The%20first%20kinetic%20typography%20film%20%5B1988%5D%20Oliver%20Harrison%20%5Bpart%5D.:&via=YouTube&related=YouTube,YouTubeTrends,YTCreators The page that receives this variable then echoes it out in a refresh meta tag to redirect to a new page: <meta http-equiv="refresh" content="0; url= <?php echo $_GET[‘id’]; ?>" /> The problem is that $_GET in the above example contains multiple variables after the initial $id variable, meaning that rather than redirecting to the above URL in its entirety, it instead redirects to: www.twitter.com/intent/tweet?url=http%3A//youtu.be/gvckPiuN9ug Is there a simple way around this? Many thanks, Leao Quote Link to comment Share on other sites More sharing options...
trq Posted May 31, 2014 Share Posted May 31, 2014 You do realise what you are doing is opening a huge security hole? Your basically allowing anyone to inject content directly into your page. Quote Link to comment Share on other sites More sharing options...
Leao Posted June 1, 2014 Author Share Posted June 1, 2014 (edited) Oops, I didn't realise this. Thanks Leao Edited June 1, 2014 by Leao Quote Link to comment Share on other sites More sharing options...
Frank_b Posted June 1, 2014 Share Posted June 1, 2014 you can redirect straight out of php <?php header("Location: http://www.example.com?id=1&name=frank"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; ?> Of course you will need to generate the url string to get this done but that is not too difficult. Beware that you have to use the header function before you made a single output. (ouput like html and e.g. with the echo function from out php) Quote Link to comment 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.