Greetings ;)

Well i need some help here.

I got a site and people click on link on my site

Example!
the link is www .mysite.com/redirect.php/url=www.google.com/search.php?word=computer&pages=195&country=us&ip=127.0.0.1

So when somebody click on it they will beredirect to my redirect.php file for a check at link.

-----------------------------
<?php
$url = $_GET;
$myPostbackUrl=$url;


$PbUrl=$myUrl.'&name='.bob;


header('location:'.$PbUrl);

?>
--------------------------------
This is the script inside the redirect.php


But here is the problem, when the script redirect it only take some "words" or what i should call them.


When it redirect after the script - http:// google.com/search.php?word=computer?name=bob
As you can see it miss some words like pages,country and ip.

it seems that the script only grab the url to the first &, and the delete the rest :(


So i would really appericate if someone could help me solve this strange problem :)

Member Avatar for diafol
<?php
if(isset($_GET) && !empty($_GET)){
	$qs = $_GET;	
	$pu = parse_url($_SERVER["REQUEST_URI"]);
	$path = explode("=",$pu['path']);
	$callback = $path[1];
//TEST OUTPUT
	echo $callback . " --- ";
	print_r($qs);
}
?>

<a href="/redirect.php/url=www.google.com/search.php?word=computer&pages=195&country=us&ip=127.0.0.1">redirect</a>

seems to work for me. easier ways to do this I'm sure - e.g. preg functions?

well it kinda work, but not that way i want it to be.. :/

Member Avatar for diafol

well it kinda work, but not that way i want it to be.. :/

Care to elaborate? My crystal ball's being polished at the moment...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.