Note that there are some explanatory texts on larger screens.

plurals
  1. POI want to display the online user when they have logged on
    text
    copied!<p>I would like to display: Logged in as:<strong><em>_</em>__<em>_</em>___</strong></p> <p>The code so far:</p> <p>The login check,</p> <pre><code>&lt;?php include('config.php'); // username and password sent from form $myemail=$_POST['myemail']; $mypassword=$_POST['mypassword']; // To protect MySQL injection $myemail = stripslashes($myemail); $mypassword = stripslashes($mypassword); $myemail = mysql_real_escape_string($myemail); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE email='$myemail' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); if($count==1){ session_start(); $_SESSION['myemail'] = $myemail; header("Location: http://www.jblanksby.yourwebsolution.net/login_success.php? user=$myemail"); } else { header("Location: http://www.jblanksby.yourwebsolution.net/loginerror.php"); } ?&gt; </code></pre> <p>The login success page/first members page,</p> <pre><code>&lt;? $email = $_GET['myemail']; session_start(); $_SESSION['myemail'] = $email; if(isset($_SESSION['email'])){ } else { echo " &lt;script language='javascript'&gt; alert('Sorry, but you must login to view the members area!') &lt;/script&gt; &lt;script&gt; window.location='http://jblanksby.yourwebsolution.net/sign_in.php' &lt;/script&gt; "; } ?&gt; &lt;html&gt; blah blah blah &lt;/html&gt; </code></pre> <p>The code used to display the users email,</p> <pre><code>Logged in as: &lt;? echo "$email"; ?&gt; </code></pre> <p>The log in side of things is perfect. Just displaying the users email is proving difficult. What have I done wrong/missed out? </p>
 

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