Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Howdo I do a php redirect? (https://www.warriorforum.com/programming/135016-howdo-i-do-php-redirect.html)

ninja newbie 16th October 2009 03:27 PM

Howdo I do a php redirect?
 
I'm sure this has probably been asked a million times already but, I need to find out how to do php redirects for my affiliate links. :confused:

TrafficMystic 16th October 2009 04:08 PM

Re: Howdo I do a php redirect?
 
Just like this ->

<?php
header("Location: http://www.trafficmystic.com");
exit;
?>

bryemidas 16th October 2009 05:23 PM

Re: Howdo I do a php redirect?
 
Hey Ninja newbie...

Try this

Open windows notepad (Start- accessories-notepad) or other text editor; create file name php redirect paste in this code


<?php
header('Location: http:// www. your affiliate link.com ');
?>

Replace the section http:// www. your affiliate link.com with you own affiliate link - Clickbank hop link or whatever.
Make sure not to remove the '); at the end of the code.

Save as product name.php so if your product is Best Cash System for example your file name would be Best-Cash-System.php

Must be saved as a php file.


Open FTP client (Filezilla for example) and in your domain public_html create a new directory (right click- create directory) and name it recommends

Still in FTP, right click drag and drop the folder product name.php from where you saved it (in your local site) to the newly created recommends directory, (in the remote site) so it can upload.

Open internet browser and type the new link into the address bar

For example your domain/ recommends/ product name.php

Remember to go back to your html editor (NVU for example) and change the link location in link properties on the actual web page so that it points correctly.

Look at the link Click Here For Instant Access on my site and you will see how the link should appear when your visitor hovers the mouse over it

It will also appear this way in view source

Check links are working and that you affiliate ID appears on the vendors sales page.

That’s it

I wish you every success

Brye

Bruce Hearder 16th October 2009 07:20 PM

Re: Howdo I do a php redirect?
 
As the guys above corrected posted the answer is :

<?php
header("Location: http://www.SiteToRedirectTo.com");
?>

But a trick for young players:

Make sure you spell the word Location with a capital "L".

After much experience with this, some hosting (especially hosting based on certain version of windows) a lower case version wont work at all, it doesn't generate an error, it just doesn't redirect at all!

So, to be safe all the time, make sure the word Location is spelt with an Uppercase "L"

Hope this helps

Bruce


All times are GMT -6. The time now is 01:17 AM.