• User Attivo

    Estrarre immagine dal database

    Ciao ho inserito un indirizzo di un immagine nel database, ho messo la query per estrarre l'immagine dal database, ma nella stanza della chat non si vedere .. dove ho sbagliato?
    [PHP]//////////////////////////
    else if($action=="addchr")
    {
    $chrnm = $_POST["chrnm"];
    $pic = $_POST["pic"];
    $pic = mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE name='pic'"));
    $chrage = $_POST["chrage"];
    $maxage = $_POST["maxage"];
    $chrpst = $_POST["chrpst"];
    $chrprm = $_POST["chrprm"];
    $chrcns = $_POST["chrcns"];
    $chrfun = $_POST["chrfun"];
    echo "<head>";
    echo "<title>Admin Tools</title>";
    echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">";
    echo "</head>";
    echo "<body>";
    echo "<p align="center">";
    if(!isadmin(getuid_sid($sid)))
    {
    echo "Permission Denied!";
    }else{
    echo $chrnm;
    echo "<br/>";
    $pic = mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE name='pic'"));
    $res = mysql_fetch_array (mysql_query("INSERT INTO ibwf_rooms SET name='".$chrnm."', pic='".$pic."', static='1', pass='', mage='".$chrage."', maxage='".$maxage."', chposts='".$chrpst."', perms='".$chrprm."', censord='".$chrcns."' , freaky='".$chrfun."'"));
    echo mysql_error();
    if($res)
    {
    echo "<img src="../images/ok.gif" alt="O"/>Chatroom added successfully";
    }else{
    echo "<img src="../images/notok.gif" alt="X"/>Error adding Chat room";
    }
    }[/PHP]
    [PHP]else if ($action=="chat")
    {
    $pic = $_POST["pic"];
    $mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));
    addonline(getuid_sid($sid),"è nella lista delle Chatroom ($mmsg)","index.php?action=chat");
    echo "<head>";
    echo "<title>Lista Chatroom</title>";
    echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">";
    echo "</head>";
    echo "<body>";
    echo "<p align="center">";
    echo "<img src="../images/chat3.gif" alt=""/>";
    echo popup($sid);
    echo "<p align="center">";
    $pic = mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE static='1'"));
    $rooms = mysql_query("SELECT id, name, perms, mage, pic, chposts FROM ibwf_rooms WHERE static='1' AND clubid='0'");
    while ($room= mysql_fetch_array($rooms))
    {
    }
    $pic = mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='1' AND clubid='0'");
    while ($room= mysql_fetch_array($rooms))

        {
          
          /*if(canenter($room[0], $sid))
          {*/
            $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'"));
            echo "<a href=\"chat.php?sid=$sid&amp;rid=$room[0]\">$room[1]($noi[0])</a><br/>";
          /*}*/
          
        }
        echo "<br/>";[/PHP]