Ciao a tutti, ho queste funzioni
Codice PHP:
$rooms = mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");
$co=0;
while ($room= mysql_fetch_array($rooms))
{
$ilink = $room[3];
if($ilink=="")
{
$ilink = "<img src=\"../images/logo.gif\" alt=\"*\"/>";
}else{
$ilink = "<img src=\"../uploaded/files/$ilink\" alt=\"*\"/>";
}
$co++;
if(canenter($room[0], $sid))
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'"));
if($room[2]=="")
{
echo "<a href=\"chat.php?sid=$sid&rid=$room[0]\">".htmlspecialchars($room[1])."($noi[0])</a><br/>";
}else{
echo htmlspecialchars($room[1]);
//echo "($noi[0])";
echo "<form action=\"chat.php\" method=\"get\">";
echo "<br/><input format=\"*x\" name=\"rpw\" maxlength=\"10\"/><br/>";
echo "<input type=\"submit\" value=\"GO\"/>";
echo "<input type=\"hidden\" name=\"rid\" value=\"$room[0]\"/>";
echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
echo "</form>";
}
}
}
$pic = mysql_escape_string($_POST["pic"]);
$pic = htmlspecialchars($pic);
$res = mysql_query("INSERT INTO ibwf_rooms SET name='".$rname."', pass='".$rpass."', censord='".$cns."', static='0', lastmsg='".time()."', pic='".$pic."'");
Codice PHP:
else if($action=="mkroom")
{
$rname = mysql_escape_string($_POST["rname"]);
$rpass = trim($_POST["rpass"]);
$pic = mysql_escape_string($_POST["pic"]);
addonline(getuid_sid($sid),"Sta creando una Chatroom","");
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
if ($rpass=="")
{
$cns = 1;
}else{
$cns = 0;
}
$prooms = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE static='0'"));
if($prooms[0]<10)
{
$pic = mysql_escape_string($_POST["pic"]);
$pic = htmlspecialchars($pic);
$res = mysql_query("INSERT INTO ibwf_rooms SET name='".$rname."', pass='".$rpass."', censord='".$cns."', static='0', lastmsg='".time()."', pic='".$pic."'");
e nella tabella rooms gli ho aggiunto: pic varchar(255) default=""
Il problema è che l'immagine casuale
Codice PHP:
$ilink = "<img src=\"../images/logo.gif\" alt=\"*\"/>";
non si vede, e se c'è la aggiungo io, si vede solo nel database, ma no in stanza, e poi non si vede neanche l'immagine da inserire
Codice PHP:
$ilink = "<img src=\"../uploaded/files/$ilink\" alt=\"*\"/>";
dove sta l'errore?