inputdata
inputdata
html
<form action=“entry.php" method="post">
First Name: <input type="text"
name="first"><br>
Last Name: <input type="text"
name="last"><br>
Phone: <input type="text"
name="phone"><br>
Mobile: <input type="text"
name="mobile"><br>
Fax: <input type="text" name="fax"><br>
E-mail: <input type="text"
name="email"><br>
<?php
$username="sanjay"; Entry.php
$password="sanjay";
$database="sanjay";
$first=$_POST['first'];
$last=$_POST['last'];
$phone=$_POST['phone'];
$mobile=$_POST['mobile'];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select
database");
?>
</body>
</html>
student.html
<form action="stu_entry.php"
method="post">
Name: <input type="text"
name="first"><br>
Branch: <input type="text"
name="branch"><br>
Theory Marks: <input type="text"
name="theory"><br>
Practical: <input type="text"
name="practical"><br>
Sex: <input type="text"
name="sex"><br>
<input type="Submit">
<?php Stu_entry.php PAGE –
1/2
$username="sanjay";
$password="sanjay";
$database="Student";
$first=$_POST['first'];
$branch=$_POST['branch'];
$theory=$_POST['theory'];
$practical=$_POST['practical'];
$sex=$_POST['sex'];
mysql_connect(localhost,$username,
$password);
@mysql_select_db($database) or die( "Unable
Stu_entry.php PAGE –
2/2
$query = "INSERT INTO marks VALUES
('$first','$branch','$theory','$practical','$sex
','')";
mysql_query($query);
mysql_close();
echo " Record Inserted";
?>