- Home
- Categorie
- Coding e Sistemistica
- PHP
- Immagine non si vede
-
Immagine non si vede
Ciao a tutti, ho queste funzioni
[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."'");[/php]
[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."'");[/php]
e nella tabella rooms gli ho aggiunto: pic varchar(255) default=""
Il problema è che l'immagine casuale
[php]$ilink = "<img src="../images/logo.gif" alt=""/>";[/php]
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[php]$ilink = "<img src="../uploaded/files/$ilink" alt="*"/>";[/php]
dove sta l'errore?
-
se c'è la aggiungo io, si vede solo nel database, ma no in stanza, e poi non si vede neanche l'immagine da inserire
Non ho ben capito questa parte, puoi chiarirla?
-
Ciao Leviathan73,
Mettendo un indirizzo assoluto per l'immagine non funziona comunque?
Ciao,
Luca Bartoli
-
ho messo echo davanti, ora si vede, ma c'è un problema, il codice immagine lo messo nella parte dove mi interessa, ma l'immagine casuale va pure nelle altre stanze di sistema, invece dovrebbe andare solo nella stanza creata. Metto il pezzo di codice dove lo inserito..
[php]<?php
include("config.php");
include("core.php");
connectdb();
$color=$_POST;
$action=$_GET["action"];
$id=$_GET["id"];
$sid = $_GET["sid"];
$rid=$_GET["rid"];
$rpw=$_GET["rpw"];
$uid = getuid_sid($sid);
$uexist = isuser($uid);
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
$data = date("H:i");if((islogged($sid)==false)||!$uexist)
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel="stylesheet" type="text/css" href="../themes/white_medium.css">";
echo "</head>";
echo "<body>";
echo "<center>";
echo "Non sei loggato<br/>";
echo "O la tua sessione è scaduta<br/><br/>";
echo "<a href="index.php">Login</a>";
echo "</center>";
echo "</html>";
echo "</body>";
exit();
}if(isbanned($uid))
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">";
echo "</head>";
echo "<body>";
echo "<p align="center">";
echo "<img src="../images/notok.gif" alt="x"/><br/>";
echo "<b>Sei stato Bannato</b><br/><br/>";
$banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'"));
$banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
$remain = $banto[0]- time();
$rmsg = gettimemsg($remain);
echo "<b>Tempo rimasto: </b>$rmsg<br/>";
$nick = getnick_uid($banto[2]);
echo "<b>By: </b>$nick<br/>";
echo "<b>Motivo: </b>$banto[1]";
//echo "<a href="index.php">Login</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
$rooms = mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");
$ilink = $room[3];
if($ilink=="")
{
echo $ilink = "<img src="../images/logo.gif" alt=""/>";
}else{
echo $ilink = "<img src="$ilink" alt=""/>";
}
echo "<br/>";$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."'");$isroom = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE id='".$rid."'")); if($isroom[0]==0) { echo "<head>"; echo "<title>Error!!!</title>";
echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">";
echo "</head>";
echo "<body>";
echo "<center>";
echo "<b>La Room non esiste</b><br/><br/>";
echo "<a href="index.php?action=chat&sid=$sid">Chatrooms</a>";
echo "</center>";
echo "</body>";
echo "</html>";
exit();
}
$passworded = mysql_fetch_array(mysql_query("SELECT pass FROM ibwf_rooms WHERE id='".$rid."'"));
if($passworded[0]!="")
{
if($rpw!=$passworded[0])
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">";
echo "</head>";
echo "<body>";
echo "<center>";
echo "<b>Password Errata!</b><br/>";
echo "Non è possibile entrare in questa stanza<br/><br/>";
echo "<a href="index.php?action=chat&sid=$sid">Chatrooms</a>";
echo "</center>";
echo "</body>";
echo "</html>";
exit();
}
}
if(!canenter($rid,$sid))
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">";
echo "</head>";
echo "<body>";
echo "<center>";
echo "<b>Autorizzazione negata!</b><br/><br/>";
echo "<a href="index.php?action=chat&sid=$sid">Chatrooms</a>";
echo "</center>";
echo "</body>";
echo "</html>";
exit();
}addtochat($uid, $rid); $timeto = 300; $timenw = time(); $timeout = $timenw-$timeto; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; $nick = getnick_sid($sid); if ($action=="") { echo "<head>"; echo "<title>$rname</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; $unreadpopup=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_popups WHERE unread='1' AND touid='".$uid."'")); if ($unreadpopup[0]<1) { echo "<meta http-equiv=\"refresh\" content=\"30; url=chat.php?time="; echo "".date("dmHis").""; echo "&sid=$sid&rid=$rid&rpw=$rpw\">"; } echo "</head>"; echo "<body>";
$mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));
addonline($uid,"Chatta in $rname ($mmsg)","chat.php?rid=$rid&rpw=$rpw");
//echo "<p>";
echo popup($sid);
echo "<b>1 </b><a name="top" id="top" accesskey="1" href="chat.php?action=say&sid=$sid&rid=$rid&rpw=$rpw">Scrivi</a><br/>";
echo "<b>2 </b><a accesskey="2" href="#opt">vai giu</a><br/>";
echo "<b>* </b><a accesskey="*" href="chat.php?time=";
echo "".date("dmHis")."";
echo "&sid=$sid&rid=$rid&rpw=$rpw">Aggiorna</a><br/>";$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'")); $unrd="".$unreadinbox[0].""; if ($unreadinbox[0]>0)[/php]:bho: