/    Sign up×
Community /Pin to ProfileBookmark

sytax error help

why is this function tossing me this error

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

[CODE]
function account_namevalid(){
return (ereg(‘^[-!#$%&’*+\./0-9=?A-Z^_`a-z{|}~]+’. ‘@’.'[-!#$%&’*+\/0-9=?A-Z^_`a-z{|}~]+.’ . ‘[-!#$%&’*\./0-9=?A-Z^_`a-z{|}~]+$’, $_POST[’email’]));
}
[/CODE]

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@bokehOct 27.2006 — why is this function tossing me this error[/QUOTE]It's not!
Copy linkTweet thisAlerts:
@keko2005authorOct 27.2006 — well its saying that line of code is. but i checked my server and dummy me realized that im using php4 not 5. could that be the cause?
Copy linkTweet thisAlerts:
@bokehOct 27.2006 — well its saying that line of code[/QUOTE]The script contains a parse error. The line number returned is where the parser either gave up or believed the error to be. In other words a best guess scenario. The facts are though that in this case it got it wrong and there is no parse error in that piece of code.
Copy linkTweet thisAlerts:
@NogDogOct 27.2006 — What Bokeh is trying to tell you is that the actual syntax error may be in a line somewhere before the line number referenced in the error message. The parser is just telling you the line number where it became apparent to it that something was wrong. Most likely there's a missing semi-colon, quote, parenthese, or brace in one of the preceding lines.
Copy linkTweet thisAlerts:
@bokehOct 27.2006 — actual syntax error may be in a line somewhere before the line number referenced in the error message[/QUOTE]This is sort of misleading because it appears you are saying (at least to me) the script is read from the top down so the error must be at or above the reported line number. Although this is normally the case on occasion I have found the error below the reported line. I believe this may be a two step process. If the file doesn't parse a second process runs that analizes the script, maybe even starting from ends and working in to find the point where the error probably is.
Copy linkTweet thisAlerts:
@netbuddyOct 27.2006 — The line number is an indication of where the interpreter got lost and couldnt understand what you were asking it to do so it gave up and gave a line number where is last knew what to do, this does not mean that the line in question referenced is faulty but just that around that number is a problem with the script, usually a typo like...

mismatched {} 's

missing ()'s or mismatched ( & )'s

new lines where none should be

" " & ' ' being mixed or overlapped, " ' " ' or [b]'[/b]Hi how[b]'[/b]s it going?[b]'[/b] for example

just for example.
×

Success!

Help @keko2005 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...