I'm trying to get text entered from url
my php contains
<?php
$GET = rawurlencode($_GET[test]);
print urldecode($GET);
?>
my text http://test.com/forum/forum.php?mod=viewthread&tid=27&extra=page%3D1
but it won't get the whole url... please help how to get full url
---edit--- to make my question more clearly
here is what i'll input in the url
http://test.com/redirect.php?test=http://test.com/forum/forum.php?mod=viewthread&tid=27&extra=page%3D1
and i want to get
http://test.com/forum/forum.php?mod=viewthread&tid=27&extra=page%3D1
your code can work normally, but I think there's a problem with $_GET[test]
since it should be
$_GET['test']
May be it will be helpfull
<?php
$uri=rawurldecode($_GET['test']);
echo $uri;
I figured it out, needed some string manipulation
<?php
$URL='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$pieces = explode("?test=", $URL);
echo $pieces[1];
?>