Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In line 54 (where the error is occurring)</p> <p>Change</p> <p><code>echo $_SESSION[loggedon];</code></p> <p>to</p> <p><code>echo $_SESSION['loggedon'];</code></p> <p>which means you forgot to include <code>'</code> in the session value. You should always include single quotes unless the value is a defined constant.</p> <p><strong>UPDATE</strong></p> <hr> <pre><code>&lt;?php session_start(); include 'connect.php'; echo "Hello World!"; echo $_SESSION['page']; $_SESSION['loggedon']=12345; $username=$_POST['username']; $password=$_POST['password']; $sql = "SELECT * FROM Users WHERE Username='".$username."'"; $result = mysql_query($sql) or die(mysql_error()); while ($row= mysql_fetch_array($result)) { if (($username=$row['Username'])&amp;&amp;($password=$row['Password'])) { $_SESSION['loggedon']=$row['AccessLevel']; $_SESSION['userid']=$row['UserID'];}} if ($_SESSION['loggedon']==12345) { $sql = "SELECT * FROM RedundantUsers WHERE Username='".$username."'"; $result = mysql_query($sql); while ($row= mysql_fetch_array($result)) { $_SESSION['loggedon']=$row['AccessLevel']; $_SESSION['userid']=$row['UserID']; $userid =$row['UserID']; $forename =$row['Forename']; $surname =$row['Surname']; $email =$row['Email']; $usernamec =$row['Username']; $access =$row['AccessLevel']; $sql = "INSERT INTO Users (UserID, Forename, Surname, Email, Username, AccessLevel) VALUES ('$userid', '$forename', '$surname', '$email', '$usernamec', '$access')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } $sql = "DELETE * FROM RedundantUsers WHERE Username='".$usernamec."'"; }} date_default_timezone_set('UTC'); $date = date("Y-m-d H:i:s"); global $usernamec; $sql = "UPDATE Users SET Datecreated='".$date."' WHERE Username='".$usernamec."'"; if (!@mysql_query($sql)) { die('Error: ' . mysql_error()); } echo $_SESSION[loggedon]; header('Location: /'.$_SESSION[page]); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload