1. #1
    Avatar von ZarneXxX
    Registriert seit
    05.04.2012
    Beiträge
    934
    Thanked 1.291 Times in 258 Posts

    Standard row lasst befehle nicht anzeigen! (Entweder Bild oder Rest)

    Hallo zusammen,

    irgendwie lässt $row mein Script nicht anzeigen
    PHP-Code:
    <?php
    if(isset($_GET["post"])) {
    if(
    $_GET["post"]=="new") {
    ?>
    <div id="contenttop_m1">
        <div class="thepet2">
            <div id="newsbackground">
                <div id="PrivateNachrich_head">
                    <p>
                    <span class="PrivateNachricht_Titel">EINE NEUE NACHRICHT SENDEN
                            <a href="index_private.php" style="float:right;outline-style:none;background-color:#222222;border-width:1px;border-color:#181818;font-size:14px;color:#444444;padding:3px 10px 3px 10px;cursor:pointer;border-style:solid;-moz-border-radius:3px;display: inline-block;">Zur&uuml;ck</a>
                    </span>
                    </p>
                </div>
            </div>
        </div>
    </div>
    <?php
    if(isset($_POST["back"])) {
        echo 
    '<meta http-equiv="refresh" content="0; URL=index_private.php">';
    }
    if(isset(
    $_GET["to"])) {
        
    $to $_GET["to"];
    } else 
    $to "";
    if(isset(
    $_GET["betreff"])) {
        
    $betreff $_GET["betreff"];
    } else 
    $betreff "";
    ?>
    <br>
    <div id="contenttop_m1">
        <div class="thepet2">
            <div id="newsbackground">
                <form action="index_private.php?post=new" method="POST">
                    <div class="PrivateNachrich_SubTitel">
                        <font color="#FFDB22">Empf&auml;nger</font>
                        <br><br>
                        <input type="text" class="PrivateNachrich_Textbox" id="inputtext" value="<?php echo $to?>" name="to">
                        <span style="float:right;font-size:10px;color:#444444;padding:0px 13px 0px 0px;margin-top:-7px;">Benutzernamen des Empf&auml;ngers hier eintragen.</span>
                    </div>
                    
                    <br>
                    <br>
                    
                    <div class="PrivateNachrich_SubTitel">
                        <font color="#FFDB22">Betreff</font>
                        <br>
                        <br>
                        <input type="text" class="PrivateNachrich_Textbox" style="color:#437BA1" id="inputtext" value="<?php echo $betreff?>" name="betreff"><br>
                        <span style="float:right;font-size:10px;color:#444444;padding:0px 13px 0px 0px;margin-top:-7px;">Den Titel der Nachricht hier eintragen.</span>
                        <br>
                        <br>
                        <font color="#FFDB22">Nachricht</font>
                        <br>
                        <br>
                        <textarea class="PrivateNachrich_TextboxBIG" style="color:#437BA1;height:200px;" name="nachricht" id="textarea"><?php $a str_replace("<br />"" "$text);echo $a?></textarea><br>
                        <input class="btn" type="submit" value="Nachricht senden!" name="sendengo" id="buttons">
                    </div>
                </form>
            </div>
        </div>
    </div>



                        <?php
                        
    if(isset($_POST["sendengo"])){
                            
    $to $_POST["to"];
                            
    $betreff $_POST["betreff"];
                            
    $text $_POST["nachricht"];
                            
    $text preg_replace('/\r\n|\r/'"<br>"html_entity_decode($_POST["nachricht"]));
                            
    $db = new Database();
                            
    $db2 = new Database();
                            
    $db2->query("SELECT * FROM users WHERE username='".htmlentities(trim(stripslashes(mysql_real_escape_string($to))))."'");
                                foreach(
    $db2->rows() as $row) {
                                    
    $zu $row["id"];
                                }
                                if(
    $zu!="") {
                                
    $datum date("d.m.Y");
                                
    $db->InsertInto("INSERT INTO `post` (`post_id`, `from`, `to`, `betreff`, `text`, `datum`) VALUES 
                                ('','"
    $username ."','".$to."','".htmlentities(trim(stripslashes(mysql_real_escape_string($betreff))))."','".html_entity_decode(trim(stripslashes(mysql_real_escape_string($text))))."','".$datum."')");
                                echo 
    "<script>alert('Message Gesendet!');</script>";
                            } else echo 
    "<script>alert('Dieser User existiert nicht!');</script>";
                        } 
    //Button nicht gedrückt
    } elseif($_GET["post"]=="ges") {
    ?>
    <div id="contenttop_m1">
        <div class="thepet2">
            <div id="newsbackground">
                <div id="PrivateNachrich_head">
                    <p>
                    <span class="PrivateNachricht_Titel">GESENDETE NACHRICHTEN
                            <a href="index_private.php" style="float:right;outline-style:none;background-color:#222222;border-width:1px;border-color:#181818;font-size:14px;color:#444444;padding:3px 10px 3px 10px;cursor:pointer;border-style:solid;-moz-border-radius:3px;display: inline-block;">Zur&uuml;ck</a>
                    </span>
                    </p>
                </div>
            </div>
        </div>
    </div>
    <br>
    <?php
    if(isset($_POST["newmsg"])) {
        echo 
    '<meta http-equiv="refresh" content="0; URL=index_private.php?post=new">';
    }
    if(isset(
    $_POST["ges"])) {
        echo 
    '<meta http-equiv="refresh" content="0; URL=index_private.php?post=ges">';
    }
    ?>
    <div id="contenttop_m1" style="float:left;">
        <div class="thepet2" style="float:left;">
            <div id="newsbackground" style="float:left;">
                                <?php
                                $dbmsg 
    = new Database();
                                
    $dbmsg->query("SELECT * FROM `post` WHERE `from`='".$username."' ORDER BY `post_id` DESC");

                                foreach(
    $dbmsg->rows() as $row) {
                                    
    $active $row["active"];
                                    
                                    if(
    $active==0) {
                                    
    $blub1 '<img src="../img/msg_system_unread.png">';
                                    
    $blub2 '<img src="../img/msg_system_error.png" style="width:24;height:24;padding:7px 0px 7px 0px;">';
                                    
    $blub3 '<font color="#FFDB22">';
                                    
    $blub4 '</font>';
                                    } else {
                                    
    $blub1 '<img src="../img/msg_system_read.png">';
                                    
    $blub2 '<img src="../img/msg_system_tick.png" style="width:24;height:24;padding:7px 0px 7px 0px;">';
                                    
    $blub3 '';
                                    
    $blub4 '';
                                    }
    $req_user trim($row["to"]);
    $req_user_info $database->getUserInfo($row["to"]);
    if(!
    $req_user || strlen($req_user) == ||
       !
    eregi("^([0-9a-z])+$"$req_user) ||
       !
    $database->usernameTaken($req_user)){
       die(
    "Nicht gefunden.");
    }

    $username $row["to"];

    $query mysql_query("SELECT * FROM users WHERE username='$username'");
    if (
    mysql_num_rows($query)==0)
        die (
    "User not found!");
    else
    {

        
    $NICHT_DEFINIERT mysql_fetch_assoc($query);
        
    $location $row['imagelocation'];
                                    echo 
    '
                <div id="msg_system_show_head">
                    <div id="msg_system_show_avatar">
                        <img src="../'
    .$location.'" style="width:32;height:32;margin:1px;">
                    </div>
                    
                    <div id="msg_system_show_status1">
                        <div id="msg_system_show_status2">
                            '
    .$blub2.'
                            <span class="msg_system_show_status3">
                                '
    .$blub1.'
                            </span>
                        </div>
                    </div>
                    
                    <div id="msg_system_show_info1">
                        <div id="msg_system_show_info2">
                            <a href="index_private.php?post='
    .$row["post_id"].'">'.$blub3.$row["betreff"].$blub4.'</a>
                            <span class="msg_system_show_info3">
                                von '
    ;
                    if(
    $req_user_info['userlevel'] == 9){ // Administrator
                    
    echo "<a href=\"index_profil.php?user=".$row["to"]."\"><font color=\"#008DE4\"><b>".$row["to"]."</b></font></a>";}
                    if(
    $req_user_info['userlevel'] == 8){ // Co-Leader
                    
    echo "<a href=\"index_profil.php?user=".$row["to"]."\"><font color=\"#60ff60\"><b>".$row["to"]."</b></font></a>";}
                    if(
    $req_user_info['userlevel'] == 7){ // Moderator
                    
    echo "<a href=\"index_profil.php?user=".$row["to"]."\"><font color=\"#ffaaff\"><b>".$row["to"]."</b></font></a>";}
                    if(
    $req_user_info['userlevel'] == 6){ // Staff Team
                    
    echo "<a href=\"index_profil.php?user=".$row["to"]."\"><font color=\"#ffff60\"><b>".$row["to"]."</b></font></a>";}
                    if(
    $req_user_info['userlevel'] == 5){ // V.I.P. Member
                    
    echo "<a href=\"index_profil.php?user=".$row["to"]."\"><font color=\"#a00000\">".$row["to"]."</font></a>";}
                    if(
    $req_user_info['userlevel'] == 4){ // SnowBreeze Stamm Mitglied
                    
    echo "<a href=\"index_profil.php?user=".$row["to"]."\"><font color=\"#ffffff\">".$row["to"]."</font></a>";}
                    if(
    $req_user_info['userlevel'] == 3){ // SnowBreeze Mitglied
                    
    echo "<a href=\"index_profil.php?user=".$row["to"]."\"><font color=\"#c8c8c8\">".$row["to"]."</font></a>";}
                    if(
    $req_user_info['userlevel'] == 2){ // SnowBreeze Probe Mitglied
                    
    echo "<a href=\"index_profil.php?user=".$row["to"]."\"><font color=\"#404040\">".$row["to"]."</font></a>";}
                    if(
    $req_user_info['userlevel'] == 1){ // Normaler Mitglied
                    
    echo "<a href=\"index_profil.php?user=".$row["to"]."\">".$row["to"]."</a>";}
                    echo
    '
                            </span>
                        </div>
                    </div>

                    <div id="msg_system_show_time1">
                        <div id="msg_system_show_time2">
                            '
    .$row["datum"].'
                            <span class="msg_system_show_time3">
                                xx:xx
                            </span>
                        </div>
                    </div>
                </div>'
    ;
                                }
                                }
                                
    ?>
            </div>
        </div>
    </div>
            <?php                    
    } elseif($_GET["post"]!="") {


    $post_id $_GET["post"];
                        
    $asd = new Database();
                        
    $asd->query("SELECT * FROM `post` WHERE `post_id`='".$post_id."'");
                        if(
    $asd->numRows()!=0) {
                            foreach(
    $asd->rows() as $row) {
                                
    $to $row["to"];
                                
    $from $row["from"];
                                
    $betreff $row["betreff"];
                                
    $name $row["from"];
                                
    $text $row["text"];
                                
    $datum $row["datum"];
                                
    $active $row["active"];
                            }
                            if(
    $to==$username) {
                            
    ?>
                            <h1>Posteingang</h1>
    <div id="news" style="">
        <p>
            <form action="index_private.php?post=<?php echo $post_id?>" method="POST">
                <a href="index_private.php?post=new&to=<?php echo $from?>&betreff=RE:<?php echo $betreff?>" style="font-size: 150%;color:grey;border:1px solid grey;background:#F2F2F2;padding-left:15px;padding-right:15px;">Antworten</a>
                <input type="submit"  style="font-size: 150%;color:grey;border:1px solid grey;background:#F2F2F2;padding-left:15px;padding-right:15px;" value="L&ouml;schen" name="delmsg">
                <a href="index_private.php" style="font-size: 150%;color:grey;border:1px solid grey;background:#F2F2F2;padding-left:15px;padding-right:15px;">Back</a>
            </form>
        </p>
    </div>
    <?php
    if(isset($_POST["back"])) {
        echo 
    '<meta http-equiv="refresh" content="0; URL=index_private.php">';
    }
    if(isset(
    $_POST["delmsg"])) {
        
    $asd1 = new Database();
        
    $yey $asd1->InsertInto("DELETE FROM `post` WHERE `post_id`='".$post_id."'");
        if(
    $yey==true) {
        } echo 
    "<script>alert('Du hast diese nachricht geloescht!');return true;</script><meta http-equiv='refresh' content='0; URL=index_private.php'>";
    }
    if(isset(
    $_POST["newmsg"])) {
        echo 
    '<meta http-equiv="refresh" content="0; URL=index_private.php?post=new&to='.$from.'&betreff=RE:'.$betreff.'">';
    }
                            
                                
                                echo 
    "<div id='news'><h2>von<i> ".$from." </i>| am <i>".$datum."</i></h2><br>";
                                echo 
    '<form action="?post='.$post_id.'" method="POST">';
                                echo 
    "<div style='font-family:Comic Sans MS;font-size:120%;color:grey;'>".$text."</div></div>";
                                echo 
    "<br><br><br>";
                                
    //Update status
                                
    $dbuptodate = new Database();
                                
    $dbuptodate->InsertInto("UPDATE `post` SET `active`='1' WHERE `post_id`='".$post_id."'");
                                
                                
                            } elseif(
    $from==$username) { 
                            
    ?>
                                                    <h1>Posteingang</h1>
    <div id="news" style="">
        <p>
            <form action="index_private.php?post=<?php echo $post_id?>" method="POST">
                <a href="index_private.php?post=new&to=<?php echo $from ?>&betreff=RE:<?php echo $betreff?>" style="font-size: 150%;color:grey;border:1px solid grey;background:#F2F2F2;padding-left:15px;padding-right:15px;">Antworten</a>
                <a href="index_private.php" style="font-size: 150%;color:grey;border:1px solid grey;background:#F2F2F2;padding-left:15px;padding-right:15px;">Back</a>
            </form>
        </p>
    </div>
    <?php
    if(isset($_POST["back"])) {
        echo 
    '<meta http-equiv="refresh" content="0; URL=index_private.php">';
    }

    if(isset(
    $_POST["newmsg"])) {
        echo 
    '<meta http-equiv="refresh" content="0; URL=index_private.php?post=new&to='.$from.'&betreff=RE:'.$betreff.'">';
    }
                            
                                
                                echo 
    "<div id='news'><h2>An<i> ".$to." </i>| am <i>".$datum."</i></h2><br>";
                                echo 
    '<form action="?post='.$post_id.'" method="POST">';
                                echo 
    "<div style='font-family:Comic Sans MS;font-size:120%;color:grey;'>".$text."</div></div>";
                                echo 
    "<br><br><br>";
                                
    //Update status
                            
                            
                            
    } else echo "<script>alert('Du hast keine Rechte dies zusehen!');return true;</script><meta http-equiv='refresh' content='0; URL=index_private.php'>";
                        } else echo 
    "<script>alert('Diese Nachricht ist nicht verfuegbar!');return true;</script><meta http-equiv='refresh' content='0; URL=index_private.php'>";    

    } else echo 
    "fehler"

    //
    } else {
    ?>
    <h1>Posteingang</h1>
    <div id="news" style="">
        <p>
            <form action="index_private.php" method="POST">
                <a href="index_private.php?post=new" style="font-size: 150%;color:grey;border:1px solid grey;background:#F2F2F2;padding-left:15px;padding-right:15px;">Neue Nachricht</a>
                <a href="index_private.php?post=ges" style="font-size: 150%;color:grey;border:1px solid grey;background:#F2F2F2;padding-left:15px;padding-right:15px;">Gesendete</a>
            </form>
        </p>
    </div>
    <?php
    if(isset($_POST["newmsg"])) {
        echo 
    '<meta http-equiv="refresh" content="0; URL=index_private.php?post=new">';
    }
    if(isset(
    $_POST["ges"])) {
        echo 
    '<meta http-equiv="refresh" content="0; URL=index_private.php?post=ges">';
    }
    ?>
    <div id="news">
        <table style="font-size:140%;">
                                <tr>
                                    <td style="font-size:100%;width:200px;"><h2>Von</h2></td>
                                    <td style="font-size:100%;width:550px;"><h2>Betreff</h2></td>
                                    <td style="font-size:100%;"><h2>Datum</h2></td>
                                </tr>
                                <?php
                                $dbmsg 
    = new Database();
                                
    $dbmsg->query("SELECT * FROM `post` WHERE `to`='".$username."' ORDER BY `post_id` DESC");

                                foreach(
    $dbmsg->rows() as $row) {
                                    
    $active $row["active"];
                                    
                                    if(
    $active==0) {
                                    
    $blub1 "<b>";
                                    
    $blub2 "</b>";
                                    } else {
                                    
    $blub1 "";
                                    
    $blub2 "";
                                    }
                                    echo 
    "<tr><td>".$blub1.$row["from"].$blub2."</td>
                                    <td><a href='index_private.php?post="
    .$row["post_id"]."'>".$blub1.$row["betreff"].$blub2."</a></td>
                                    <td>"
    .$blub1.$row["datum"].$blub2."</td></tr>";
                                }
                                
    ?>
                            </table>
    </div>
    <?php
    }
    ?>
    Wenn ich:
    PHP-Code:
        $row mysql_fetch_assoc($query); 
    mache, funktioniert das Bild aber der rest wird nicht angezeigt.
    Wenn ich aber es so mache:
    PHP-Code:
        $NICHT_DEFINIERT mysql_fetch_assoc($query); 
    sprich irgendein quatsch (jedenfalls nicht $row) wird das Bild nicht angezeigt aber der rest!

    Ich will das Beides angezeigt wird!
    Kann mir jemand da helfen?

  2. #2
    Avatar von Devon
    Registriert seit
    18.11.2011
    Beiträge
    2.188
    Thanked 1.574 Times in 1.023 Posts

    Standard AW: row lasst befehle nicht anzeigen! (Entweder Bild oder Rest)

    Darf ich fragen wieso du dein Bild nicht auch einfach in der Datenbank hinterlegst und es dann mittels $row["pic"] o.Ä. ausgibst? Ich weiß ja nicht wie das dargestellt werden soll, aber mit echo und while könnte man das einfacherer ausgeben..

  3. #3
    Avatar von ZarneXxX
    Registriert seit
    05.04.2012
    Beiträge
    934
    Thanked 1.291 Times in 258 Posts

    Standard AW: row lasst befehle nicht anzeigen! (Entweder Bild oder Rest)

    Zitat Zitat von Devon Beitrag anzeigen
    $row["pic"]
    Hab ich doch?
    PHP-Code:
        $location $row['imagelocation']; 
    auch wenn ich in der anzeige '.$row["imagelocation"].' mache, kommt das selbe Ergebnis raus.
    imagelocation = Pfad zum Bild

  4. #4
    Avatar von Devon
    Registriert seit
    18.11.2011
    Beiträge
    2.188
    Thanked 1.574 Times in 1.023 Posts

    Standard AW: row lasst befehle nicht anzeigen! (Entweder Bild oder Rest)

    Was bezeichnest du mit "Beides"? Was genau soll da nun angezeigt werden? Durch deinen Code steigt man null durch. oO

  5. #5
    Avatar von ZarneXxX
    Registriert seit
    05.04.2012
    Beiträge
    934
    Thanked 1.291 Times in 258 Posts

    Standard AW: row lasst befehle nicht anzeigen! (Entweder Bild oder Rest)

    Zitat Zitat von Devon Beitrag anzeigen
    Was bezeichnest du mit "Beides"? Was genau soll da nun angezeigt werden? Durch deinen Code steigt man null durch. oO
    1. Bild
    2. Name / Betreff / ID / Uhrzeit

    Habs,

    PHP-Code:
        $row mysql_fetch_assoc($query);
        
    $location $row['imagelocation']; 
    geändert zu:
    PHP-Code:
        $rowUser mysql_fetch_assoc($query);
        
    $location $rowUser['imagelocation']; 
    Hatte $row doppelt ^^
    Geändert von ZarneXxX (24.06.2013 um 20:25 Uhr)

Ähnliche Themen

  1. Lasst uns BrickForce gamen :)
    Von Shane im Forum Brick-Force
    Antworten: 13
    Letzter Beitrag: 09.05.2012, 15:34
  2. Bild ausschneiden (nicht leicht)
    Von x BoooM x im Forum Angebot & Nachfrage
    Antworten: 1
    Letzter Beitrag: 20.04.2012, 16:54
  3. VB.Net Imagebox zeigt Bild nicht an
    Von rVs14 im Forum .Net
    Antworten: 6
    Letzter Beitrag: 07.04.2012, 13:55
  4. YouTube Videos laden nicht, weißes Bild?!
    Von Devon im Forum Internet und Technik
    Antworten: 5
    Letzter Beitrag: 11.03.2012, 02:14
Diese Seite nutzt Cookies, um das Nutzererlebnis zu verbessern. Klicken Sie hier, um das Cookie-Tracking zu deaktivieren.