i have a redirecct script not working

  • olm75
  • Proficient
  • Proficient
  • No Avatar
  • Joined: Aug 07, 2005
  • Posts: 294
  • Status: Offline

Post February 11th, 2009, 8:58 am

ok i have a script i was trying to write it redirects and hides my affiliate links...
Code: [ Select ]
<?php
if{$link=="mickey-mouse-toaster1"{$visit="http://www.abcde.com/gp/search?ie=UTF8&keywords=mickey%20mouse%20toaster&tag=test-20&index=kitchen&linkCode=ur2&camp=1789&creative=9325"};
header{"location:$visit"};
}
?>
  1. <?php
  2. if{$link=="mickey-mouse-toaster1"{$visit="http://www.abcde.com/gp/search?ie=UTF8&keywords=mickey%20mouse%20toaster&tag=test-20&index=kitchen&linkCode=ur2&camp=1789&creative=9325"};
  3. header{"location:$visit"};
  4. }
  5. ?>

i keep on getting this error:
Parse error: syntax error, unexpected '{', expecting '(' in /home/holemcc1/public_html/mickey-mouse-toaster/unknown.php on line 2
but everytime i change it it doesnt work unless im doing it wrong not a great programmer as you can see...
can anyone help...
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 11th, 2009, 8:58 am

  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8211
  • Loc: USA
  • Status: Offline

Post February 11th, 2009, 4:03 pm

header{"location:$visit"};
should be
header("location:$visit");
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6128
  • Loc: Seattle, WA
  • Status: Offline

Post February 11th, 2009, 6:20 pm

You're using curly braces where you should be using parentheses, among other things. Note the corrections in red:

Code: [ Select ]
<?php
if( $link == "mickey-mouse-toaster1" ) {
    $visit = "http://www.abcde.com/gp/search?ie=UTF8&keywords=mickey%20mouse%20toaster&tag=test-20&index=kitchen&linkCode=ur2&camp=1789&creative=9325";
 
header("Location: $visit");
}
?>
  1. <?php
  2. if( $link == "mickey-mouse-toaster1" ) {
  3.     $visit = "http://www.abcde.com/gp/search?ie=UTF8&keywords=mickey%20mouse%20toaster&tag=test-20&index=kitchen&linkCode=ur2&camp=1789&creative=9325";
  4.  
  5. header("Location: $visit");
  6. }
  7. ?>
The Beer Monocle. Classy.
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8211
  • Loc: USA
  • Status: Offline

Post February 11th, 2009, 6:49 pm

Oops, didn't notice those stuff ... thanks spork for pointing those out.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • olm75
  • Proficient
  • Proficient
  • No Avatar
  • Joined: Aug 07, 2005
  • Posts: 294
  • Status: Offline

Post February 12th, 2009, 11:27 am

i have a question this line in the code $link == "mickey-mouse-toaster1" is this supposed to be the url link that is coming to the page or the title of the link...
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8211
  • Loc: USA
  • Status: Offline

Post February 12th, 2009, 2:48 pm

I don't know... its your script unless you are using a pre-made one... if that's the case... I won't know until you show the source of the script (Such as the URL to the place where the script resides in).
"Bring forth therefore fruits meet for repentance:" Matthew 3:8

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 198 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.