Need a new web host or having a problem with a script? Tips and advice on the best way to design, build and maintain your most valuable asset - your website!

Redirect PHP parse error

alexis
Posts: 10
Joined: 28 Apr 09
Trust:

Redirect PHP parse error

Hi,
I'm following the tutorial for making redirects for wordpress.
here's my code:
<?php
header( ‘Location: http://www.hypnosisdownloads.com/?0000’ ) ;
?>

I've done everything exactly as per instructions but I'm getting the error message as follows:
" Parse error: syntax error, unexpected ':' in /public_html/blog-ehyp/recommends/hypnosisdownloads/index.php on line 2 "

Well, I can't see an extra ":" anywhere !
Any ideas please?
Thanks
  • 1
faradina
Posts: 1895
Joined: 01 Jun 09
Trust:
Did you use Word at any phase in the process of creating your redirect file? Word is the most common culprit for parse errors. Use notepad to make your index.php redirect file.
  • 1
alexis
Posts: 10
Joined: 28 Apr 09
Trust:
Hi Faradina,

No, just notepad, clean and simple.
I don't know what else to try, at the moment I'm stuck with ugly links on my wordpress sites.
Any ideas gratefully received ! ;-)
Thanks
  • 1
faradina
Posts: 1895
Joined: 01 Jun 09
Trust:
Are you on Hostgator? Another member had this same problem. He's on hostgator and hostgator support went into it and cleaned out the error. Check this forum topic:

week-5-8-f37/redirect-index-php-not-working-please-help-t3744.html
  • 1
alexis
Posts: 10
Joined: 28 Apr 09
Trust:
I checked with my host, Bluehost and the problem is that the link I was using uses the single exclamation mark as here: '
When I use the double one, as here: "
the link works perfectly.
Hope this helps somebody. ;-)
  • 1
jasondodd
Posts: 752
Joined: 08 Feb 09
Trust:
It appears something similar was happening on this wordpress site with a parse error.

The code Mark posted used the double quotes but also has an exit line. The exit stops any further code being executed on the page and can sometimes be an effective security measure against any malicious code being run on the page.
  • 1
Limited time special - Try Affilorama Premium for just $1 for 7 days: https://www.affilorama.com/premium
 
abrandan
Posts: 7
Joined: 23 Nov 09
Trust:
I seemed to have the same error when I used Notedpad. But using TextEditor on a Mac seems to work fine with the redirect for Clickbank products.
However, when I use an affiliate code for another outfit, even though I use the exact same php code with the new affiliate code I get the same error mentioned above. Maybe I'm wrong but I think some affiliate programs are blocking the redirect - am I wrong? (and I'm using the exit code that Mark used). The affiliate program I'm taking about is ShareASale.
  • 1
Angela B
 
Moderator
evobilly
Posts: 662
Joined: 27 Oct 08
Trust:
ive seen this issue around and i think it is coursed in some cases by the comma ' there are some that have a little curl on them well other look like a little straght dash and it seems it donsn't like the curl as it must see it different.

try copy and paste this code see if it works
  • 1
For the best guide to sell physcal products as a affiliate check out Matt Carters Rapid Profit Formula http://online-income-masters.com/getrapidprofitformula.php

If your having trouble re-writing your articles i recommend checking out this tool to make it quick and easy http://goto2.com/rewriter

If you want to outsource your articles this place seems to be good value and easy to deal with, and its free to sign up they offer a 100% American writing team http://bit.ly/bhv4Fu
 
PremiumMember
nick
Posts: 216
Joined: 17 May 06
Trust:
Indeed. It also pays to put an exit after it as well

<?php
header('Location: ......');
exit;
?>
  • 1

This topic was started on Jul 20, 2009 and has been closed due to inactivity. If you want to discuss this topic further, please create a new forum topic.