Parse error: syntax error, unexpected T_STRING, expecting ':' or ';'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sclarkstone
    New Member
    • Jun 2008
    • 9

    Parse error: syntax error, unexpected T_STRING, expecting ':' or ';'

    Im getting this error;
    Parse error: syntax error, unexpected T_STRING, expecting ':' or ';'
    with this line;

    [HTML]header ('postcodesearc h.php?e=nw&pcod e=',[$origPostCode]);[/HTML]

    I cant find whats wrong, can anyone help?
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Remove the brackets from around your variable.

    Comment

    • sclarkstone
      New Member
      • Jun 2008
      • 9

      #3
      just tried it, im getting the same error on that line

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by sclarkstone
        just tried it, im getting the same error on that line
        My apologies - I'm running slow today!
        When using a header, you have to declare sub-function, shall we say, before you pass a parameter.

        So,
        Code:
        header("Location: location-goes-here.php");

        Comment

        Working...