

![]() |
| ![]() | |||||||
|
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) | |
| DNF Member Last Online: Yesterday 04:09 PM iTrader: (22) Join Date: Jul 2007
Posts: 553
DNF$: 1,777 Location: United States
Country: | Jump Script Parse Error I am going crazy trying to get a simple jump script setup for affiliate links. I keep getting the following error. PHP Parse error: parse error, unexpected T_STRING in Line 2 on the following script: Quote:
| |
| | |
| Sponsored Ads |
| | #2 (permalink) |
| www.LOL.biz Name: Daniel Last Online: Today 03:30 PM iTrader: (14) Join Date: Apr 2004
Posts: 1,893
DNF$: 5,662 Location: .ro
Country: | -where is $o defined? Code: <?
switch($o)
{
case "l2":
$redirect="http://www.link2.com";
break;
case "l1":
$redirect="http://www.link1.com";
break;
}
header("Location: ".$redirect);
?>
__________________ Refinance Leads| Last edited by Bender; 10-26-2007 at 12:35 PM.. |
| | |
| | #3 (permalink) |
| DNF Member Last Online: Yesterday 04:09 PM iTrader: (22) Join Date: Jul 2007
Posts: 553
DNF$: 1,777 Location: United States
Country: | I have my links built like this: http://www.example.com/jumpscript.php?o=l1 http://www.example.com/jumpscript.php?o=l2 I tried the above script and got the same results. Even with a simple header redirect without variables, I'm getting parse errors. Could there be a server setting, htaccess or php.ini that I'm missing? |
| | |
| | #5 (permalink) |
| www.LOL.biz Name: Daniel Last Online: Today 03:30 PM iTrader: (14) Join Date: Apr 2004
Posts: 1,893
DNF$: 5,662 Location: .ro
Country: | Code: <?
switch($_GET['o'])
{
case "l2":
$redirect="http://www.link2.com";
break;
case "l1":
$redirect="http://www.link1.com";
break;
}
header("Location: ".$redirect);
?>
__________________ Refinance Leads| |
| | |
| | #6 (permalink) |
| DNF Member Last Online: Yesterday 04:09 PM iTrader: (22) Join Date: Jul 2007
Posts: 553
DNF$: 1,777 Location: United States
Country: | bender - that worked out. thanks so much. i had a combination of issues - one, was editing in wordpad for some reason and it was throwing in odd formatting. once i cleared that up, it was clear that the variable wasn't being defined and your new script solved that. thanks again. |
| | |
| | #7 (permalink) |
| www.LOL.biz Name: Daniel Last Online: Today 03:30 PM iTrader: (14) Join Date: Apr 2004
Posts: 1,893
DNF$: 5,662 Location: .ro
Country: | glad to help whenever I can.
__________________ Refinance Leads| |
| | |
| | #9 (permalink) |
| DNF Member Last Online: Yesterday 04:09 PM iTrader: (22) Join Date: Jul 2007
Posts: 553
DNF$: 1,777 Location: United States
Country: | if you look online the first script i posted seems to be the norm. any specific reason the variable o wasn't being defined in my version? i'm still a copy and paste php hack, but slowly learning. |
| | |
| | #10 (permalink) |
| www.LOL.biz Name: Daniel Last Online: Today 03:30 PM iTrader: (14) Join Date: Apr 2004
Posts: 1,893
DNF$: 5,662 Location: .ro
Country: | the $o variable wasn't defined - you expected to be automatically extracted from the $_GET variables, but this is no longer the case in newer PHP versions(security reasons) you could use an extract($_GET) but this NOT recommended
__________________ Refinance Leads| |
| | |
| | #11 (permalink) |
| Platinum Lifetime Member Name: Jason Last Online: 02-03-2009 08:34 PM iTrader: (10) Join Date: Nov 2006
Posts: 493
DNF$: 5,125 Location: USA
Country: | You could also do something like... Code: function pop_vals($associative_array) {
foreach ($associative_array as $key=>$val) {
eval('$'.$key.' = "'.$val.'";");
}
}
pop_vals($_REQUEST);
// $o should now be defined
YOURURL?o=|1&SOMEREMOTECOMMANDSHERE Jason
__________________ |
| | |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |