View Single Post
  #1  
Old 26th December 2022, 16:21
Floky123 Floky123 is offline
Senior Member
 
Join Date: Nov 2013
Slovenia
Posts: 55
Default Problem with shoutbox
Hi i have problem with shoutbox when i try to write something i become this error:

SQL Error
Incorrect integer value: 'id' for column `admin_infire`.`shoutbox`.`id` at row 1
in /home/admin/domains/******/public_html/shoutbox.php, line 61

My shoutbox.php:


Quote:
<?php
require_once("include/bittorrent.php");
dbconn(false);
loggedinorreturn();
parked();
iplogger();
if (isset($_GET['del']))
{
if (is_valid_id($_GET['del']))
{
if ( (get_user_class() >= UC_MODERATOR) ) {
sql_query("DELETE FROM shoutbox WHERE id=".mysql_real_escape_string($_GET['del']));
}
}
}
?>
<html><head>
<title>ShoutBox</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<META HTTP-EQUIV=REFRESH CONTENT="10; URL=shoutbox.php">
<style type="text/css">
A {color: #000000; font-weight: bold; }
A:hover {color: #FF0000;}
.small {font-size: 8pt; font-family: tahoma; }
.date {font-size: 7pt;}
</style>
<STYLE>BODY {
background-color: #F0F0E6;
SCROLLBAR-3DLIGHT-COLOR: #004E98;
SCROLLBAR-ARROW-COLOR: #004E98;
SCROLLBAR-DARKSHADOW-COLOR: white;
SCROLLBAR-BASE-COLOR: white;
}
</STYLE>
</head>
<body bgcolor=#F5F4EA>
<?
mysql_query("UPDATE users SET chat_access='" . get_date_time() . "' WHERE id=" . mysql_real_escape_string($CURUSER["id"]));// or die(mysql_error());
/*
if ($CURUSER["chatpost"] == 'no')
{
print("<h2><br><center>You are banned.</center></h2>");
exit;
}
else
{
*/

if($_GET["sent"]=="yes")
if(!$_GET["shbox_text"])
{
$userid=0+$CURUSER["id"];
}
else
{
$userid=0+$CURUSER["id"];
$username=htmlspecialchars(trim($CURUSER["username"]));
$date=sqlesc(time());
$text=trim($_GET["shbox_text"]);

sql_query("INSERT INTO shoutbox (id, userid, username, date, text) VALUES ('id'," . sqlesc($userid) . ", " . sqlesc($username) . ", $date, " . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__);
print "<script type="text/javascript">parent.document.shbox.shbox_text.value ='';</script>";
}

$res = sql_query("SELECT * FROM shoutbox ORDER BY date DESC LIMIT 70") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 0)
print("\n");
else
{
print("<table border=0 cellspacing=0 cellpadding=2 width='100%' align='left' class='small'>\n");

while ($arr = mysql_fetch_assoc($res))
{
$res2 = sql_query("SELECT username,class,avatar,donor, title,enabled,warned FROM users WHERE id=$arr[userid]") or sqlerr(__FILE__, __LINE__);
$arr2 = mysql_fetch_assoc($res2);
$resowner = sql_query("SELECT id, username, class FROM users WHERE id=$arr[userid]") or print(mysql_error());
$rowowner = mysql_fetch_array($resowner);


if ($rowowner["class"] == "8")
$usercolor= "<font color=#500000>" .htmlspecialchars($rowowner["username"]). "</font>";
if ($rowowner["class"] == "7")
$usercolor= "<font color=green><b>" .htmlspecialchars($rowowner["username"]). "</b></font>";
if ($rowowner["class"] == "6")
$usercolor= "<font color=red>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "5")
$usercolor= "<font color=blue>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "4")
$usercolor= "<font color=orange>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "3")
$usercolor= "<font color=brown>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "2")
$usercolor= "<font color=purple>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "1")
$usercolor= "<font color=black>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif ($rowowner["class"] == "0")
$usercolor= "<font color=black>" .htmlspecialchars($rowowner["username"]). "</font>";

if (get_user_class() >= UC_MODERATOR) {
$del="<span class='date'>[<a href=shoutbox.php?del=".$arr[id].">del</a>]</span>";
}

print("<tr><td><span class='date'>[".strftime("%d.%m %H:%M",$arr["date"])."]</span>
$del
</span>
<a href='userdetails.php?id=".$arr["userid"]."' target='_blank'>$usercolor</a>" .
($arr2["donor"] == "yes" ? "<img src=pic/star.gif alt='DONOR'>" : "") .
($arr2["warned"] == "yes" ? "<img src="."pic/warned.gif alt='Warned'>" : "") .
" ".format_comment($arr["text"], 0)."
</td></tr>\n");
}
print("</table>");
}
?>
</body>
</html>
Reply With Quote