Hello, Soooo i created a simple login system, and I am using sessions  Everything seems to work fine, however; when I upload my files to my server and type my domain name my index.php page comes up and the form is automatically filled out with a username and password. How do i make it empty when I initially enter the site, and yes I did create a logout.php file that destroys a session. Please help, it is hard to explain this when I cant show it in person. Thanks in advance!

Here is the login.php code, i didn't md5() the password yet:


if ($_SESSION['user'])
    header("Location: error.php");
if ($_POST['login']){

$sql="SELECT * FROM members WHERE username='$_POST[user]' and password='$_POST[pass]'";
$result=mysql_query($sql, $con);
if ($count==1){
  $_SESSION['user'] = $user;
  header('location: home.php');
    echo "<p style='color:red'>Wrong Username or Password</p>";

        <link href="" rel="stylesheet" type="text/css" />
        <div id="main">
            <div id="menu">
                        <a href="">Home</a>
                        <a href="">Topix</a>
                        <a href="">Mission</a>
            <div id='content'>
                <form method='post' action=''>
                    Username: <br/>
                    <input type='text' name='user' maxlength='30'/><br/>
                    Password: <br/>
                    <input type="password" name='pass' maxlength='30'/><br/>
                    <input type="submit" value="Log In!" name="login"/>
                <a href=""> Register? </a>

Reply via email to