Getting URL parameter from redirect URL

eternalwarrior

Senior Member
Joined
Oct 7, 2012
Messages
1,010
Reaction score
397
How do I get URL parameter from redirect URL?


Like the redirect url here is


a-domain.com/tracking/go.php?c=variables&s={keyword} which will be
redirected to b-domain.com/landing-page.php


I want the parameter of the redirect URL "{keyword}" to be received by the final page and show it up in b-domain.com/landing-page.php


I have used the following code in b-domain.com/landing-page.php:


<?php
$target = $_GET['s'];
?>
<h1>Welcome <?php echo $target; ?> Visitors!!!</h1>


But it's not working. Can anyone help me in this?
 
Last edited:
$_SERVER['HTTP_REFERER'] is your friend.
 
Thanks jazzc.

I got the solution anyway. I have to edit the redirect php file to pass the variables from redirect URL to final destination URL by putting the code given below:

Code:
<?php header("http://domain-b.com/?s=".$_GET['s']); die(); ?>
 
Back
Top