Advertisement
Guest User

asdasdasdasdasdasdasd

a guest
Apr 5th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <title>Page Title</title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <link rel="stylesheet" type="text/css" media="screen" href="main.css">
  9. <script src="main.js"></script>
  10. </head>
  11. <body>
  12. <h2>
  13. Strona
  14. </h2>
  15. <div>
  16. <?php
  17. if(isset($_POST['data']) && isset($_POST['tekst'])){
  18. $username = "ziembajakub";
  19. $password = "ziembaj";
  20. $host = "localhost";
  21. $dbName = "ziembajakub";
  22. $data = $_POST['data'];
  23. $text = $_POST['tekst'];
  24. $sql2 = "insert into tab1 (id, text, data) values (null,'$text', '$data');";
  25. $con = mysqli_connect($host,$username,$password,$dbName);
  26. if(!$con){
  27. echo "Error: ".mysqli_error($con);
  28. }
  29. $sql = "select * from tab1;";
  30. $result = mysqli_query($con,$sql);
  31. $result2 = mysqli_query($con,$sql2);
  32. if($result2){
  33. echo "gicik";
  34. }
  35. if($result){
  36. while($row = mysqli_fetch_assoc($result)){
  37. echo "<div>".$row['id']." ".$row['text']." ".$row['data']."</div>";
  38. }
  39. }
  40. mysqli_close($con);
  41. }
  42.  
  43. // $imie = $_POST['imie'];
  44. // $wiek = $_POST['wiek'];
  45. // $kolor = $_POST['kolor'];
  46. // $tekst = $_POST['tekst'];
  47. // echo "<p>".$imie."</p><br><p>".$wiek."<br><p style='background-color:".$kolor."'>".nl2br($tekst)."</p><br>";
  48. // echo str_replace("-",".",$_POST['data']);
  49. // ?>
  50. </div>
  51. </body>
  52. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement