Advertisement
Guest User

Yaros_The_Great

a guest
Jun 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Insert Data</title>
  4. </head>
  5. <body>
  6. <center>
  7. <h2> Insert Your Daily Taks </h2>
  8. <?php
  9.  
  10. $con = mysqli_connect("localhost","phpmyadmin","yaros8");
  11. if(!$con)
  12.     {
  13.         echo 'Connection to Server';
  14.     }
  15. if(!mysqli_select_db($con,'Yaros'))
  16.     {
  17.         echo 'Database Not Selected';
  18.     }
  19. $name = $_POST['Mytask'];
  20. $sql = "INSERT INTO Tasks (TASK) VALUES ('$name')";
  21.    
  22. if(!mysqli_query($con,$sql))
  23.     {
  24.         echo 'not inserted';
  25.     }  
  26.    
  27. ?>
  28.  
  29.  
  30.     <form action="Test.php" method="post">
  31.         New Task : <input type="text" name="Mytask">
  32.             <br>
  33.             <input type="submit" value="Create">
  34.    
  35.     </form>
  36.  
  37.    
  38. </center>  
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement