Advertisement
Guest User

Untitled

a guest
May 14th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.95 KB | None | 0 0
  1. <html>
  2.  
  3. <body>
  4.  
  5. <?php
  6.  
  7. if ($submit) {
  8.  
  9.         // process form
  10.  
  11. $hostname = "localhost";
  12. $username = "igo";
  13. $password = "monster";
  14. $dbName = "irabd";
  15. $userstable = "user";
  16.  
  17. mysql_connect($hostname,$username,$password) OR DIE("Не могу создать соединение ");
  18.  
  19. mysql_select_db($dbName) or die(mysql_error());
  20.  
  21.         $sql = "INSERT INTO employees (reg_day,eg_mounth,reg_year,INN) VALUES ('$reg_day','$reg_mounth','$reg_year','$INN')";
  22.  
  23.         $result = mysql_query($sql);
  24.  
  25.         echo "Thank you! Information entered.\n";
  26.  
  27. } else{
  28.  
  29.         // display form
  30.  
  31.         ?>
  32.  
  33.         <form method="post" action="">
  34.  
  35.         reg_day:
  36.           <input type="Text" name="first"><br>
  37.  
  38.         reg_mounth:
  39.         <input type="Text" name="last"><br>
  40.    
  41.         reg_year:
  42.         <input type="Text" name="address"><br>
  43.  
  44.         INN:<input type="Text" name="position"><br>
  45.  
  46.         <input type="Submit" name="submit" value="Enter information">
  47.  
  48.         </form>
  49.  
  50.         <?php
  51.  
  52. }
  53.  
  54. // end if
  55.  
  56. ?>
  57.  
  58. </body>
  59.  
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement