Advertisement
Guest User

Untitled

a guest
Mar 25th, 2016
617
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. if ($conn->connect_error) {
  2.     die("Connection failed: " . $conn->connect_error);
  3. }
  4.  
  5.    
  6.     if($_SERVER['REQUEST_METHOD'] === 'POST')
  7.     {
  8.         if (strlen($nick) <= 1 or strlen($msg) <= 1)
  9.         {
  10.             header("Location: blad.php");
  11.  
  12.         }
  13.         else
  14.         {
  15.             $sql1 = "INSERT INTO adminmsg VALUES('$nick','$msg','NULL')";
  16.             $conn->query($sql1);
  17.             header("Location: sukces.php");
  18.         }
  19.            
  20.        
  21.            
  22.         exit();
  23.     }
  24.  
  25.  
  26. $sql = "SELECT * FROM adminmsg";
  27.  
  28. $result = $conn->query($sql);
  29.  
  30. if ($result->num_rows > 0) {
  31.     // output data of each row
  32.      while($row = $result->fetch_assoc()) {
  33.     echo '<table width="1000">';
  34.     echo "<tr>";
  35.        
  36.          echo  "<p style='width:100%; height:70px; background-color:#838C8F; color:white; line-height:200%; font-size:35px; '>".$row['Wiadomosc']."&nbsp".$row['User'].'</td>'."</p>".'<a style="text-decoration: none; color:white; background:#737373; min-height:50px; padding:20px; positon:relative;
  37.         width:150px;" href="usun.php?id=$id">UsuÅ„<a>';
  38.         echo "</tr>";
  39.          
  40.          
  41.          
  42.     echo "</table>";
  43.     }
  44.    
  45. } else {
  46. }
  47.  
  48. $conn->close();
  49.  
  50. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement