תגידו יש לי טעות בקוד הבא???
PHP קוד:
<?
oB_start();
include("config.php");
if (!$logged[username])
{
if (!$_POST[login])
{
echo("
<html>
<p align='center'><u><b><font color='#2BB0E3' face='Arial' size='5'>התחברות </font>
</b></u></p>
<form method='post' action='login.php'>
<table width='405' border='0' align='center'>
<tr bgcolor='#0099FF'>
<td align='right' width='343'>
<input name='username' type='text' id='username' size='20'></td>
<td width='52' align='right' class='text'>:שם משתמש</td>
</tr>
<tr bgcolor='#00CCFF'>
<td align='right' width='343'>
<input name='password' type='text' id='password' size='20'></td>
<td align='right' class='text' width='52'>:סיסמא</td>
</tr>
<tr bgcolor='#0099FF'>
<td align='right' width='343' dir='ltr'>
<p align='center'><input type='reset' name='reset' value='נקה טופס' class='buttons'><input type='submit' name='login' value='שלח' class='buttons'></td>
</tr>
</table>
</form>
<p align='center'><b><font color='#00CCFF' face='Arial'>אתה לא רשום?אז <u>
<a href='register.php'>הרשם</a></u> עכשיו</font></b></p>");
}
if ($_POST[login]) {
$username=$_POST['username'];
$password = md5($_POST['password']);
$info = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($info);
if($data['password'] != $password) {
echo "שם משתמש או סיסמה לא נכונים";
}else{
$query = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$user = mysql_fetch_array($query);
setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=login.php\"/>תודה לך אתה מועבר לפאנל הניהול");
}
}
}
else
{
$new = mysql_query("select * from pmessages where unread = 'unread' and touser = '$logged[username]'");
$new = mysql_num_rows($new);
echo ("<html dir='rtl'><center><u><b><font face='Arial' size='5' color='#2BB0E3'>שלום $logged[username]</font>
</b></u><br /></center><font face='Arial'><b>
<li><a href=\"editprofile.php\">ערוך פרופיל</a><br /></li>
<li><a href=\"members.php\">רשימת משתמשים</a><br /></li>
<li><a href=\"messages.php\">הודעות פרטיות חדשות ($new)</a><br /></li><br><br>
<li><a href=\"logout.php\">התנתק</a></li></font></b></html>");
}
?>