hi, ich hab zu folgendem code ne frage, kann man den noch besser optimieren verkleinern?
if (isset($_COOKIE['forum_userid'])) {
$userid = $_COOKIE['forum_userid'];
$retid = mysql_query("SELECT * FROM users WHERE userid = '{$userid}'");
$row = mysql_fetch_assoc($retid);
$userpw = $_COOKIE['forum_userpassword'];
$retid_pw = mysql_query("SELECT * FROM users WHERE password = '{$userpw}'");
$row_pw = mysql_fetch_assoc($retid_pw);
$sql = "SELECT
userid, password
FROM
users
WHERE
userid=$userid";
$result = mysql_query($sql);
$row_pw = mysql_fetch_array($result, MYSQL_ASSOC);
if($row_pw['password'] == $userpw) {
print_r ($row['username']);
echo "<br />\n<a href="login.php">User Panel</a><br />\n";
} else {
echo "Gast (<a href="login.php">Login</a>)<br />\n";
echo "<a href="login.php">Registrieren</a><br />\n";
echo "<a href="login.php">Info</a><br />\n";
}
}else {
echo "Gast (<a href="login.php">Login</a>)<br />\n";
echo "<a href="login.php">Registrieren</a><br />\n";
echo "<a href="login.php">Info</a><br />\n";
}
mfg schrub