שמעו יש לי את הקוד הבא:
PHP קוד:
<?
ob_start()
?>
<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<title>דירוג תמונות</title>
</head>
<body>
<?
include('config.php');
$id = $_GET['id'];
if(isset($id) == false) {
echo "בחר משתמש<br>";
$q=mysql_query("SELECT * FROM rating");
while($r = mysql_fetch_array($q)) {
$id = $r['id'];
$username = $r['username'];
echo "<a href='index.php?id=$id'>$username</a><br>";
}
echo "<br>";
} elseif(isset($id) == true) {
$q=mysql_query("SELECT * FROM rating WHERE id = $id");
while($r = mysql_fetch_array($q)) {
$id = $r['id'];
$username = $r['username'];
$email = $r['email'];
$icq = $r['icq'];
$pic = $r['pic'];
$about= $r['about'];
$rate = $r['rate'];
echo "<table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#066095' width='26%' id='AutoNumber1' height='110'>
<tr>
<td width='100%' height='30' bgcolor='#BEE4FC'>
<p align='center'><font face='Arial'><b>שמי:<span lang='en-us'>$username</span></b></font></td>
</tr>
<tr>
<td width='100%' height='19' bgcolor='#BEE4FC'>
<p align='center'><font face='Arial'><b>קצתת עליי:<span lang='en-us'><br>
$about</td>
</tr>
<tr>
<td width='100%' height='19' bgcolor='#BEE4FC'>
<p align='center'><font face='Arial'><b>תמונה<span lang='en-us'>:<br>
<a href='$pic'><img src='$pic' width='160' height='171' border='0'></a></td>
</tr>
<tr>
<td width='100%' height='19' bgcolor='#BEE4FC'>
<p align='center'><b><font face='Arial'>יצירת קשר:</font></b></td>
</tr>
<tr>
<td width='100%' height='19' bgcolor='#BEE4FC'>
<p align='center'><b><font face='Arial'>אימייל:<span lang='en-us'><a href='mailto:$email'>$email</a></span></font></b></td>
</tr>
<tr>
<td width='100%' height='19' bgcolor='#BEE4FC'>
<p align='center'><b><font face='Arial'>איסיקיו:<span lang='en-us'>$icq</span></font></b></td>
</tr>
<tr>
<td width='100%' height='19' bgcolor='#BEE4FC'>
<p align='center'><b><font face='Arial'>הדירוג שלי:<span lang='en-us'>$rate</span></font></b></td>
</tr>
</table>";
}
$q=mysql_query("SELECT * FROM rating_ip WHERE where = $id'");
while($r = mysql_fetch_array($q)) {
$where = $r['where'];
$ip = $r['ip'];
if($ip == $_SERVER['REMORE_ADDR']) {
echo "";
} else {
echo "
<form method='POST' action='index.php?action=rate&id=$id'>
<p>
1:<input type='radio' value='1' checked name='R1'>
2:<input type='radio' value='2' name='R1'>
3:<input type='radio' value='3' name='R1'>
4:<input type='radio' value='4' name='R1'>
5:<input type='radio' value='5' name='R1'>
6:<input type='radio' value='6' name='R1'>
7:<input type='radio' value='7' name='R1'>
8:<input type='radio' value='8' name='R1'>
9:<input type='radio' value='9' name='R1'>
10:<input type='radio' value='10' name='R1'>
</p>
<p> <input type='submit' value='דרג' name='submit'></p>
</form>";
?>
<br>
<br>
<a href="index.php">חזור לכל המשתמשים</a> ||
<?
}
}
$action = $_GET['action'];
$seta = $_POST['R1'];
$q=mysql_query("SELECT * FROM rating");
while($r = mysql_fetch_array($q)) {
$rate = $r['rate'];
$sete=$seta+$rate;
$set=$sete/2;
if($action == rate) {
$ip = $_SERVER['REMOTE_ADDR'];
$where = $_GET['id'];
mysql_query("INSERT TO rating_ip(ip,where) VALUES ('$ip','$where')");
mysql_query("UPDATE rating SET rate = $set where ID =$id");
header ("location:index.php?id=$id");
}
}
?>
<a href="register.php">הרשם עכשיו</a>
</body>
</html>
וזה מציג לי את הבעיה:
PHP קוד:
Warning: Unexpected character in input: '' (ASCII=31) state=1 in /home/miro/domains/afrsek.net/public_html/rate/index.php on line 113
Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/miro/domains/afrsek.net/public_html/rate/index.php on line 113
לא הבנתי מזה כלום