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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.