Advertisement
Guest User

Untitled

a guest
Jun 11th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <title>ankieta</title>
  5. </head>
  6. <body>
  7. <?php
  8. ini_set('display_errors', 1);
  9. ini_set('display_startup_errors', 1);
  10. error_reporting(E_ALL);
  11. $servername = "userdb1";
  12. $username = "1152511_ZmC";
  13. $password = "X1HhiLWB5fQ9IO";
  14. $baza="1152511_ZmC";
  15. session_start();
  16. // Create connection
  17. @ $db = new mysqli($servername, $username, $password,$baza);
  18. if(mysqli_connect_errno()){
  19. echo "błąd połącznia";
  20. exit();}
  21. $ip=$_SERVER['REMOTE_ADDR'];
  22. $pyt="SELECT * from kultura where ip='$ip'";
  23. $wynik=$db->query($pyt);
  24. $ile=$wynik->num_rows;
  25. if($ile>=50){
  26. echo "Wypełniłeś juz 50 razy";
  27. $db->close();
  28. session_destroy();}
  29. else{
  30. if(isset($_POST['check1'])){
  31. $check1=$_POST['check1'];}
  32. else {$check1="";}
  33.  
  34. if(isset($_POST['check2'])){
  35. $check2=$_POST['check2'];}
  36. else {$check2="";}
  37.  
  38. if(isset($_POST['check3'])){
  39. $check3=$_POST['check3'];}
  40. else {$check3="";}
  41.  
  42. if(isset($_POST['check4'])){
  43. $check4=$_POST['check4'];}
  44. else {$check4="";}
  45.  
  46. if(isset($_POST['check5'])){
  47. $check5=$_POST['check5'];}
  48. else {$check5="";}
  49.  
  50. if(isset($_POST['check6'])){
  51. $check6=$_POST['check6'];}
  52. else {$check6="";}
  53.  
  54. if(isset($_POST['check7'])){
  55. $check7=$_POST['check7'];}
  56. else {$check7="";}
  57.  
  58. if(isset($_POST['check8'])){
  59. $check8=$_POST['check8'];}
  60. else {$check8="";}
  61.  
  62. if(isset($_POST['text1'])){
  63. $text1=$_POST['text1'];}
  64. else {$text1="";}
  65.  
  66. if(isset($_POST['radio1'])){
  67. $radio1=$_POST['radio1'];}
  68. else {$radio1="";}
  69.  
  70. /*if(isset($_POST['plec'])){*/
  71. /*$plec=$_POST['plec'];}*/
  72. /*else {$plec="";}*/
  73. /*echo "Plec to: $_POST['plec']";*/
  74.  
  75.  
  76. $zapytanie="Insert into kultura(check1,check2,check3,check4,check5,check6,check7,check8,text1,radio1,plec, ip) VALUES ('$check1','$check2','$check3','$check4','$check5','$check6','$check7','$check8','$text1','$radio1','$plec','$ip')";
  77. $wynik1=$db->query($zapytanie);
  78. echo "Dziękujemy za wypełnienie ankiety";
  79. echo '<br><a href="test.php">Powrót</a>';
  80. $db->close();}
  81. ?>
  82. </body>
  83. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement