Guest User

Untitled

a guest
Apr 10th, 2018
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1.  
  2. Pers1.html
  3. <html>
  4. <head>
  5. <title>
  6. <h1 style="color:blue">personal information system</h1>
  7. </title>
  8. <style>
  9. body{background-color:powderblue;}
  10. </style>
  11. </head>
  12. <body>
  13. <form method="post" action="pis1.php">
  14. Name:<input type="text" name="t1"><br/>
  15. Id :<input type="text" name="t2"><br/>
  16. DOB :<input type="text" name="t3"><br/>
  17. Gender:<input type="text" name="t4"><br/>
  18. Mobile:<input type="text" name="t5"><br/>
  19. Address:<input type="text" name="t6"><br/>
  20. Occupation:<input type="text" name="t7"><br/>
  21. Religion:<input type="text" name="t8"><br/>
  22. Language:<input type="text" name="t9"><br/>
  23. Maritalstatus:<input type="text" name="t10"><br/>
  24. Salary:<input type="text" name="t11"><br/>
  25. <input type="submit" value="enter">
  26. </form>
  27. </body>
  28. </html>
  29. Pers1.php
  30. <?php
  31. $Name=$_POST['t1'];
  32. $Id=$_POST['t2'];
  33. $DOB=$_POST['t3'];
  34. $Gender=$_POST['t4'];
  35. $Mobile=$_POST['t5'];
  36. $Address=$_POST['t6'];
  37. $Occupation=$_POST['t7'];
  38. $Religion=$_POST['t8'];
  39. $Language=$_POST['t9'];
  40. $Maritalstatus=$_POST['t10'];
  41. $Salary=$_POST['t11'];
  42. //$regno = isset($_POST['regno']) ? $_POST['regno'] : '';
  43. $conn = mysqli_connect('localhost', 'root','') or die("cannot connect");
  44. mysqli_select_db($conn,'pis') or die("cannot select DB");
  45. $res = mysqli_query($conn,"insert into personaldetails values('$Name','$ID','$DOB','$Gender','$Mobilenumber','$Address','$Occupation','$Religion','$Mothertongue','$Maritalstatus','$Salary')") or die(mysqli_error());
  46. if($res>0)
  47. {
  48. echo "Record created";
  49. echo "$ID";
  50. }
  51. ?>
Add Comment
Please, Sign In to add comment