-
24.06.2013, 03:34 #1
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ü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ä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ä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ü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) == 0 ||
!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ö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
}
?>
PHP-Code:$row = mysql_fetch_assoc($query);
Wenn ich aber es so mache:
PHP-Code:$NICHT_DEFINIERT = mysql_fetch_assoc($query);
Ich will das Beides angezeigt wird!
Kann mir jemand da helfen?
-
24.06.2013, 03:48 #2
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..
-
24.06.2013, 04:13 #3
-
24.06.2013, 07:51 #4
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
-
24.06.2013, 11:11 #5
AW: row lasst befehle nicht anzeigen! (Entweder Bild oder Rest)
Ähnliche Themen
-
Lasst uns BrickForce gamen :)
Von Shane im Forum Brick-ForceAntworten: 13Letzter Beitrag: 09.05.2012, 15:34 -
Bild ausschneiden (nicht leicht)
Von x BoooM x im Forum Angebot & NachfrageAntworten: 1Letzter Beitrag: 20.04.2012, 16:54 -
VB.Net Imagebox zeigt Bild nicht an
Von rVs14 im Forum .NetAntworten: 6Letzter Beitrag: 07.04.2012, 13:55 -
YouTube Videos laden nicht, weißes Bild?!
Von Devon im Forum Internet und TechnikAntworten: 5Letzter Beitrag: 11.03.2012, 02:14
Diese Seite nutzt Cookies, um das Nutzererlebnis zu verbessern. Klicken Sie hier, um das Cookie-Tracking zu deaktivieren.