Thursday, 3 November 2016

Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in * on line 1

I'm following the tutorial here to create a login page using MySQL. The code seemed to be working flawlessly when I left my computer 2 days ago. Now I come back to work on it, haven't changed anything, and I'm greeted with this warning:




Warning: Use of undefined constant php - assumed 'php' (this will
throw an Error in a future version of PHP) in /filelocation/login.php
on line 1




Line 1 in login.php literally says only this:






It also seems like this warning is breaking the form. When I hit the "login" button, nothing happens besides being redirected right back to the login page to try again.



Why would this be happening?



edit* As requested here is the fist couple lines of my code. Simply copy-pasted:




// Initialize the session
session_start();

// Check if the user is already logged in, if yes then redirect him to welcome page
if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
header("location: welcome.php");
exit;
}

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...