I am trying this code to create a simple log in and registration page but its giving me an error on line 13. I don’t know how to fix it. Please help
[php]
<a href=login.php<Log In | Register }else{ echo "Welcome, ".$username." Logout"; } ?>
[/php]
I am trying this code to create a simple log in and registration page but its giving me an error on line 13. I don’t know how to fix it. Please help
[php]
[/php]
You had a missing quote and missing quotations around the href and your anchor tag had an inverted carrot “<”. Those darn fat fingers.
[php]<?php
//This will start a session
session_start();
$username = $_SESSION[‘username’];
$psssword = $_SESSION[‘password’];
//Check do we have username and password
if(!username && !password) {
echo “Welcome Guest!
Log In | Register”
}
else
{
echo “Welcome, “.$username.” Logout”;
}
?>[/php]
also im pretty sure this line will need some work
[php]if(!username && !password) {[/php]