i have a redirecct script not working

  • olm75
  • Proficient
  • Proficient
  • olm75
  • Posts: 294

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

header{"location:$visit"};
should be
header("location:$visit");
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6251
  • Loc: Seattle, WA

Post 3+ Months Ago

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. ?>
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

Oops, didn't notice those stuff ... thanks spork for pointing those out.
  • olm75
  • Proficient
  • Proficient
  • olm75
  • Posts: 294

Post 3+ Months Ago

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
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

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).

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 76 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.