jpress07 Posted June 8, 2008 Share Posted June 8, 2008 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 https://forums.phpfreaks.com/topic/109251-probably-very-basic-php-redirection-error/ Share on other sites More sharing options...
Alexhoward Posted June 8, 2008 Share Posted June 8, 2008 Hi, your header code looks fine. try taking out the php. it looks like it's seeing it all as one line so, <? header( 'Location: http://my-affiliate-offer-link.com' ) ; ?> Link to comment https://forums.phpfreaks.com/topic/109251-probably-very-basic-php-redirection-error/#findComment-560404 Share on other sites More sharing options...
jpress07 Posted June 9, 2008 Author Share Posted June 9, 2008 Thanks Alex! Worked a charm. Much appreciated. Cheers, JP Link to comment https://forums.phpfreaks.com/topic/109251-probably-very-basic-php-redirection-error/#findComment-560830 Share on other sites More sharing options...
Guest Xanza Posted June 9, 2008 Share Posted June 9, 2008 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 https://forums.phpfreaks.com/topic/109251-probably-very-basic-php-redirection-error/#findComment-560950 Share on other sites More sharing options...
Alexhoward Posted June 10, 2008 Share Posted June 10, 2008 Hi, No worries jpress07 and nice little script Xanza jpress hit the solved button at the bottom of the page if you've finished with this post. it'll help others find complete answers to their queries Cheers dude! Link to comment https://forums.phpfreaks.com/topic/109251-probably-very-basic-php-redirection-error/#findComment-562098 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.