Advertisement
Guest User

martin

a guest
Mar 16th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <?php
  2.  
  3. //this is for database connection!
  4.  
  5. //name of your host
  6. $host = "localhost";
  7. //username of your database
  8. $username = "root";
  9. //password of your database default is blank
  10. $password = "";
  11. //name of your database
  12. $dbname = "myheroacademia";
  13.  
  14. $con = mysqli_connect("$host","$username","$password","$dbname");
  15.  
  16. if(mysqli_connect_error()){
  17. echo "Connection error";
  18.  
  19. }else{
  20.  
  21. }
  22.  
  23. ?>
  24.  
  25. <?php
  26. if(isset($_GET['subm­­­it']))
  27. {
  28. $StudentID = isset($_GET["num1"]);
  29. $FirstName = isset($_GET["num2"]);
  30. $LastName = isset($_GET["num3"]);
  31. $Course = isset($_GET["num4"]);
  32. $Birthdate = isset($_GET["num5"]);
  33. $General = isset($_GET["num6"]);
  34.  
  35. $sql=mysqli_query($con,"INSERT INTO table(StudentID,FirstName,LastName,Course,Birthdate,Gender) VALUES ('$StudentID','$Firstname','$Lastname','$Course','$Birthdate','$Gender')");
  36.  
  37. }
  38. ?>
  39.  
  40. <img src="myhero.jpeg" WIDTH=1022, HEIGHT=188 border"3" >
  41.  
  42. <html>
  43. <head>
  44. <title>Student Information</title>
  45. </head>
  46. <body>
  47.  
  48. <h1 align=center>STUDENT­­­ INFORMATION</h1>
  49.  
  50. <form align=center>
  51. <div>StudentID:</­­­div>
  52. <input type="StudentID"name­­­="num1"/>
  53. <div>FirstName:</­­­div>
  54. <input type="FirstName"name­­­="num2"/>
  55. <div>LastName:</div>
  56. <input type="LastName"name=­­­"num3"/>
  57. <div>Course:</div>
  58. <input type=:"Course"name="­­­num4"/>
  59. <div>Birthdate:</­­­div>
  60. <input type="Birthdate"name­­­="num5"/>
  61. <div>Gender:</div>
  62. <input type="Gender"name="n­­­um6"/>
  63. <p> </p>
  64. <button name="submit">SUBMIT­­ TO U.A.</button>
  65.  
  66. <?php
  67.  
  68.  
  69. ?>
  70.  
  71. </body>
  72. </head>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement