Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- if($_SERVER['REQUEST_METHOD'] === 'POST')
- {
- if (strlen($nick) <= 1 or strlen($msg) <= 1)
- {
- header("Location: blad.php");
- }
- else
- {
- $sql1 = "INSERT INTO adminmsg VALUES('$nick','$msg','NULL')";
- $conn->query($sql1);
- header("Location: sukces.php");
- }
- exit();
- }
- $sql = "SELECT * FROM adminmsg";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo '<table width="1000">';
- echo "<tr>";
- echo "<p style='width:100%; height:70px; background-color:#838C8F; color:white; line-height:200%; font-size:35px; '>".$row['Wiadomosc']." ".$row['User'].'</td>'."</p>".'<a style="text-decoration: none; color:white; background:#737373; min-height:50px; padding:20px; positon:relative;
- width:150px;" href="usun.php?id=$id">Usuń<a>';
- echo "</tr>";
- echo "</table>";
- }
- } else {
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement