PHP Session not started but ignored if started
Go to solution
Solved by vorticalbox,
50 minutes ago, Joveice said:Hi, I'm trying to use my function but it returns null each time there is something wrong and I know it does it on this line
if (!empty($_SESSION['errormsg'])) { return('null'); }Tho I know it's not empty because I have it echo the error message in the corner while working.
If I add session_start(); on the start of the function script file this error comes up (and still returns null).
line 14 is session_start();
Notice: A session had already been started - ignoring session_start() in *File* on line 14What is this? and how do you fix this?
you're asking if errormsg is not empty then return null. Thus if it has a value it will return. take the ! away then it will return null if empty.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now