Jump to content

Probably very basic - php redirection error


jpress07

Recommended Posts

hi guys,

 

I am a totally noob when it comes to php. Anyway, I want to link to an affiliate offer from my PPC campaign via a redirect.

 

Anyway, I have a site, let's say topamericandeals.com. I have created a page called affiliate-offer.php and placed the following code in there:

 

<?php
header( 'Location: http://my-affiliate-offer-link.com' ) ;
?>

 

So, I have the url: hxxp://topamericandeals.com/affiliate-offer.php .. I enter this into the browser, and I get this error:

 

Fatal error: Call to undefined function phpheader() in /home/mywebserver/public_html/topamericandeals/affiliate-offer.php on line 1

 

Can you php geniuses please tell me what I'm doing wrong here? Any help would be greatly appreciated.

 

Cheers,

JP

Guest Xanza

I know you've already received an answer for this question but I just wanted to share something with you - this little re-direct script that should help you with a large number of re-directs:

 

<?php
$proc = $_GET['app'];  //redirection using $_GET[]
$links = array(
    "rw" => "http://www.rippedwallet.com/pages/?refid=xanza", //simple re-direction
    "proc" => "http://www.liutilities.com/products/wintaskspro/processlibrary/$proc/" //using $_GET[]
);
header("Location:" . $links[$_GET['r']]);
exit;
?>

 

I've just always used it and I believe that it could help you. :)

 

Usage:

 

http://site.com/redirect.php?r=rw

http://site.com/redirect.php?r=proc&app=explorer

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.