Miért nem enged képeket megjeleníteni a Google Chrome?
Ez a kód, már bocs, hogy ide írom:
<div class="search"></div>
<?php
include("connect.php");
if (isset($_POST["comment"])) {
$indicator = 0;
if (!empty($_POST["comment_text"])) {
$comment = $_POST["comment_text"];
$indicator += 1;
}
if ($indicator == 1) {
$comment_sql = $conn->prepare("INSERT into comment (comment, username, ad_id) values(?,?,?)");
$comment_sql->bind_param("ssi", $comment, $_SESSION["username"], $_GET["single_ad"]);
$comment_sql->execute();
}
}
?>
<main>
<div class="advertise_holder">
<?php
if (isset($_GET["single_ad"])) {
$ad_id = mysql_real_escape_string($_GET["single_ad"]);
if (!filter_var($ad_id, FILTER_VALIDATE_INT) === false) {
}
else {
header("location:index.php");
}
}
else {
header("location:index.php");
}
$sql_single = "SELECT * from advertise where id = '".$ad_id."'";
$sql_pic = "SELECT * from adpics where id = '".$ad_id."'";
$result_single = $conn->query($sql_single);
$result_pic = $conn->query($sql_pic);
$pic_counter = 0;
$sql_title = "SELECT * from advertise where id = '".$ad_id."'";
$result_title = $conn->query($sql_title);
if ($result_title->num_rows) {
while($row = $result_title->fetch_assoc()) {
echo "<div class='ad_title'><h1>".$row["ad_title"]."</h1></div>";
echo "<br>";
echo "<br>";
}
}
if ($result_pic->num_rows) {
while($row = $result_pic->fetch_assoc()) { $pic_counter += 1; ?>
<div class="adpic_holder">
<div class="ad_pic" id="ad_pic<?php echo $pic_counter; ?>"><img src="advertise_pictures/<?php echo $row["pic"]; ?>"></div>
<?php }
}
?>
</div>
<?php
if ($result_single->num_rows) {
while($row = $result_single->fetch_assoc()) { ?>
<div class="city">
<div class="ad_phone">
<h3>Név: <?php
$username_sql = "SELECT name from registration where username = '".$row["username"]."'";
$username_result = $conn->query($username_sql);
if ($username_result->num_rows) {
while($row_usr = $username_result->fetch_assoc()) {
echo $row_usr["name"];
}
}
?>
</h3>
</div>
</div>
<div class="city">
<div class="ad_phone"><h3>Település: <?php echo $row["city"]; ?></h3></div>
</div>
<div class="phone">
<div class="ad_phone"><h3>Telefonszám: <?php echo $row["phone"]; ?></h3></div>
</div>
<div class="price">
<div class="ad_price"><h3>Ár: <?php echo $row["ad_price"] . " Ft.-"; ?></h3> </div>
</div>
<div class="message">
<div class="ad_price"><a href="?pages=private_message&single_ad=<?php echo $_GET["single_ad"] . "&username2=" . $row["username"]; ?>" target="_blanket">Üzenet küldés</a></div>
</div>
<div class="ad_text"> <?php echo $row["ad_text"]; ?> </div>
<?php } ?>
<?php } ?>
<br>
<form method="post" class="comments">
<textarea id="comment_text" name="comment_text">
</textarea>
<br>
<div class="submitholder">
<input type="submit" name="comment" class="commenteles" value="küldés!"/>
</div>
</form>
</div>
<div class="commentread">
<?php
$read_sql = "SELECT * from comment where ad_id = '".$_GET["single_ad"]."' order by timestamp DESC";
$read_result = $conn->query($read_sql);
$count_comment = 0;
if ($read_result->num_rows) {
while($row = $read_result->fetch_assoc()) { $count_comment += 1; ?>
<div class="singlecomment" id="comm<?php echo $count_comment; ?>"><h3><?php echo $row["username"]; ?> üzenete: </h3><?php echo $row["comment"] . "<br>"; echo $row["timestamp"]; ?></div>
<?php }
}
?>
</div>
</main>
Kapcsolódó kérdések:
Minden jog fenntartva © 2024, www.gyakorikerdesek.hu
GYIK | Szabályzat | Jogi nyilatkozat | Adatvédelem | Cookie beállítások | WebMinute Kft. | Facebook | Kapcsolat: info(kukac)gyakorikerdesek.hu
Ha kifogással szeretne élni valamely tartalommal kapcsolatban, kérjük jelezze e-mailes elérhetőségünkön!