Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse error: parse error, expecting `'(''

Status
Not open for further replies.

Hozzer

Technical User
Jul 30, 2009
20
CA
I have an if statement inside a function that is checking to see if a session has been set

function addNewUser
if (isset($_SESSION['hasrun'])){
do this
}else{
do this
}
The error I get is:
Parse error: parse error, expecting `'('' ... on line 143 which is the first line of the if statement.

I've searched all over google and found that my syntax is the same as all of the examples I have found...

I'm stumped :(

Any Ideas?

 
You need () in your function declaration as well as { and } to define the function scope.

Code:
function addNewUser[b]()
{[/b]
 'do stuff
[b]}[/b]

-Geates
 
Doh!!!

Thanks Geates,

I couldn't see it for looking at it :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top