Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Pers1.html
- <html>
- <head>
- <title>
- <h1 style="color:blue">personal information system</h1>
- </title>
- <style>
- body{background-color:powderblue;}
- </style>
- </head>
- <body>
- <form method="post" action="pis1.php">
- Name:<input type="text" name="t1"><br/>
- Id :<input type="text" name="t2"><br/>
- DOB :<input type="text" name="t3"><br/>
- Gender:<input type="text" name="t4"><br/>
- Mobile:<input type="text" name="t5"><br/>
- Address:<input type="text" name="t6"><br/>
- Occupation:<input type="text" name="t7"><br/>
- Religion:<input type="text" name="t8"><br/>
- Language:<input type="text" name="t9"><br/>
- Maritalstatus:<input type="text" name="t10"><br/>
- Salary:<input type="text" name="t11"><br/>
- <input type="submit" value="enter">
- </form>
- </body>
- </html>
- Pers1.php
- <?php
- $Name=$_POST['t1'];
- $Id=$_POST['t2'];
- $DOB=$_POST['t3'];
- $Gender=$_POST['t4'];
- $Mobile=$_POST['t5'];
- $Address=$_POST['t6'];
- $Occupation=$_POST['t7'];
- $Religion=$_POST['t8'];
- $Language=$_POST['t9'];
- $Maritalstatus=$_POST['t10'];
- $Salary=$_POST['t11'];
- //$regno = isset($_POST['regno']) ? $_POST['regno'] : '';
- $conn = mysqli_connect('localhost', 'root','') or die("cannot connect");
- mysqli_select_db($conn,'pis') or die("cannot select DB");
- $res = mysqli_query($conn,"insert into personaldetails values('$Name','$ID','$DOB','$Gender','$Mobilenumber','$Address','$Occupation','$Religion','$Mothertongue','$Maritalstatus','$Salary')") or die(mysqli_error());
- if($res>0)
- {
- echo "Record created";
- echo "$ID";
- }
- ?>
Add Comment
Please, Sign In to add comment