By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,925 Members | 732 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,925 IT Pros & Developers. It's quick & easy.

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

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

[HTML]header ('postcodesearch.php?e=nw&pcode=',[$origPostCode]);[/HTML]

I cant find whats wrong, can anyone help?
Jun 26 '08 #1
Share this Question
Share on Google+
3 Replies


Markus
Expert 5K+
P: 6,050
Remove the brackets from around your variable.
Jun 26 '08 #2

P: 9
just tried it, im getting the same error on that line
Jun 26 '08 #3

Markus
Expert 5K+
P: 6,050
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,
Expand|Select|Wrap|Line Numbers
  1. header("Location: location-goes-here.php");
  2.  
Jun 26 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.