fursty

create-php

Apr 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <form method="post" action="">
  2. <input type="text" name="grad" />
  3. <input type="submit" name="submit" value="Добави" />
  4. </form>
  5.  
  6. <?php
  7. include 'config.php';
  8. if(isset($_POST['submit'])){
  9. $grad = $_POST['grad'];
  10. $sql="INSERT INTO grad (grad) VALUES ('$grad')";
  11. $result = mysql_query($sql);
  12. if (!$result)
  13. {
  14. die('Error: ' . mysql_error());
  15. }
  16. echo "Добавихте един запис.";
  17. }
  18. ?>
Add Comment
Please, Sign In to add comment