PHP-Code:
<?php
session_start();
$lifeTime = 3333300;
setcookie(session_name(), session_id(), time() + $lifeTime, "/");
$userid=$_POST["userid"];
$password=$_POST["password"];
if (strlen($userid) < 1 || strlen($password)< 1){
echo "<table align='center' cellpadding='40' cellspacing='40'><tr><td><a href=\"javascript:history.back();\">Benutzername und/oder Passwort haben weniger als 5Zeichen.</table></tr></td>";
}else{
require_once("../conn.php");
mysql_select_db("account");
$exec="select id,login,cash,marken from account where login='$userid' and password=password('$password')";
$result=mysql_query($exec);
$rs=mysql_fetch_object($result);
if($rs){
$_SESSION["ID"] = $rs->id;
$_SESSION["UserID"] = $rs->Login;
$_SESSION["cash"] = $rs->cash;
$_SESSION["marken"] = $rs->marken;
header("location: shop.php");
}else{
echo "<table align='center' cellpadding='40' cellspacing='40'><tr><td><a href=\"javascript:history.back();\">Benutzer nIcht vorhanden!</a></table></tr></td>";exit;
}
}
?>
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/******o/domains/******/public_html/shop_/Loginok.php on line 15
Kommentar