GETting and Passing URL Parameters

Spliffic

Loves Cron Jobs
Apr 5, 2008
1,214
27
0
VanCity
Sorry for the newb question but I have a quick PHP question.

Let's say I have the inbound URL:
hxxp://www.Food.com/?t202id=123456&t202kw=abcd

I want to be able to encode and redirect these same t202id and t202kw variables to a different URL:
hxxp://www.FastFood.com/?t202id=123456&t202kw=abcd

Is the following snippet of code correct? I'm getting parsing errors on the GET assignments:
202id = $_GET['t202id'];
202kw = $_GET['t202kw'];
$redirect = 'hxxp://www.FastFood.com/?t202id=' . $202id +'t202kw=' . $202kw;

Can someone help me out. I'm obviously pretty new to PHP but do have a bit of a programming background. Thanks!
 


hxxp://www.Food.com/?t202id=123456&t202kw=abcd

PHP:
<?php

header('hxxp://www.FastFood.com/?t202id='.$_GET['t202id'].'&t202kw='.$_GET['t202id']);
?>
 
Thanks Matt, for some reason I'm getting the following parsing error when I use the assignment that you provided:

Parse error: syntax error, unexpected ')'

This script is sitting on hxxp://www.Food.com as index.php. Do I need to declare the t202id and t202kw vars first before doing this? Or do I need to handle them as incoming parameters first? Sorry I know I sound like a retard at this, but I've tried a bunch of shit this morning and just can't get it to work.
 
incoming like this:
hxxp://www.Food.com/?t202id=123456&t202kw=abcd

index.php
PHP:
<?php

header('location: hxxp://www.FastFood.com/?t202id='.$_GET['t202id'].'&t202kw='.$_GET['t202kw']);

?>

I did it fast and sloppy the first time, no location and wrong var.
 
Thanks for all your help bro, I was doing things a little differently (formatting the http string first, then performing the redirect afterwards using the string) but realized where I fucked up with the string.