Reputation: 35
I got this error.
Notice: Undefined variable: session_start in C:\wamp\www\check.php on line 3
It says undefined variable on line 3, but here's line 3.
$session_start();
Why is this happening? Isn't session_start predefined?
Upvotes: 0
Views: 1535
Reputation: 179046
session_start()
is a function.
$session_start
would be a variable if you defined it. The error message you're reading is simply telling you that the variable that you're trying to call as a function doesn't exist as such.
Upvotes: 6
Reputation: 57316
session_start()
is not a variable, but a function. You do not need the dollar sign. Change it to
session_start()
and it should work.
Upvotes: 2