Advertisement
Guest User

Untitled

a guest
Aug 16th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <html>
  2. <body>
  3.  
  4. <?php
  5. $servername = "10.253.---.--";
  6. $username = "intranet";
  7. $password = "----";
  8. $dbname = "intranet";
  9.  
  10. // Create connection
  11. $conn = mysqli_connect($servername, $username, $password, $dbname);
  12. // Check connection
  13. if (!$conn) {
  14. die("Connection failed: " . mysqli_connect_error());
  15. }
  16.  
  17. $sql = "INSERT INTO AdresarGIS (Adresa, Broj, Mesto, Agent, Komentar)
  18. VALUES ('$_POST[Adresa]','$_POST[Broj]','$_POST[Mesto]','$_POST[Agent]','$_POST[Komentar]' )";
  19.  
  20. if (mysqli_query($conn, $sql)) {
  21. echo "New record created successfully";
  22. } else {
  23. echo "Error: " . $sql . "<br>" . mysqli_error($conn);
  24. }
  25.  
  26. mysqli_close($conn);
  27. ?>
  28.  
  29. <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  30. <p>
  31. <label for="Adresa">Adresa</label><br/>
  32. <input type="text" name="Adresa" />
  33. </p>
  34. <p>
  35. <label for="Broj">Broj</label><br/>
  36. <input type="text" name="Broj" />
  37. </p>
  38. <p>
  39. <label for="Mesto">Mesto</label><br/>
  40. <input type="text" name="Mesto" />
  41. </p>
  42. <p>
  43. <label for="Agent">Agent</label><br/>
  44. <input type="text" name="Agent" />
  45. </p>
  46. <p>
  47. <label for="Komentar">Komentar</label><br/>
  48. <input type="text" name="Komentar" />
  49. </p>
  50. <p>
  51. <input type="submit" name="submit" value="Pošalji" />
  52. </p>
  53. </form>
  54.  
  55. </body>
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement