I have this login code. When I write on a page to request someones username, I enter <?php echo $username; ?>
but that's not the only thing I want to echo on the page. I also want to echo $website
but that doesn't work. What am I doing wrong in the code? Is there a way to also add $website to the code so it echo's the
require('connect.php');
session_start();
if (isset($_POST['username']) and isset($_POST['password'])){
$username = $_POST['username'];
$password = $_POST['password'];
$query = "SELECT * FROM `user` WHERE username='$username' and password='$password'";
$result = mysql_query($query) or die(mysql_error());
$count = mysql_num_rows($result);
if ($count == 1){
$_SESSION['username'] = $username;
}else{
echo "";
}
}
if (isset($_SESSION['username'])){
$username = $_SESSION['username'];
echo "Your username is " . $username;
echo "Your domain is " . $website;
} else {
?>
<!--loginpage follows here -->
EDIT
I mean when a customer registers their account, they need to fill out a form and they need to enter their site. How can I, by using the above script, echo the $website so they see their own website printed?