second: I've got 2 small problems again:
#1: In the Input-text is my server address enterd... why? (it's automatly enterd! when i'm opening that page)
#2: Why is there always standing "You are logged in now"? it just should stay there when the password and username is true...
(im talking about my login page)
here is it: login.php
<?php
session_start();
echo "<form action='?act=login' method='post'>"
."Username: <input type='text' name='user' size='30'><br>"
."Password: <input type='password' name='pass' size='30'><br>"
."<input type='submit' value='Login'>"
."</form>"
."</br> <a href=index.php> Index </a>";
$pass = md5($_POST[pass]);
$user = $_POST[user];
//Connecting to database
$connect = mysql_connect("localhost", "browsergamesc", "------------------------------------------------------");
if(!$connect){
die(mysql_error());
}
mysql_select_db("browsergamesc",$connect);
$search = "SELECT * FROM users WHERE username='$user'";
$res = mysql_query($search) OR die(mysql_error());
$check = mysql_fetch_array($res);
if($check[username] == $user && md5($check[password]) == $pass)
{
$_SESSION[login] = TRUE;
$_SESSION['user'] = $user;
$_SESSION['pass'] = $pass;
$_SESSION['geld'] = $check['geld'];
echo "</br>You are now Logged in! <a href=index.php> </br>Back to Index </a>";
}
else
{
echo "</br>";
echo "</br> Wrong username or password";
session_destroy(); }
?>
Help me pls, thanks
Please report errors in the Staredit.Network forum.







