Experiment: Write a HTML program to design an entry form of student details and send it to store at database server like SQL, Oracle or MS Access.
--Web Technology-Lab--

Student Entry Form

Name (Max 5 char*)
Email ID
(Max 5 Char* Don't write @gmail.com)
Mobile Number (Max 5 Digits)
Gender
Date Of Birth
City (Max 4 Char*)
State (Max 5 Char* Allowed)
Country (Max 5 Char*)
Qualification



Courses
Applied For

Welcome to quiz

Q1.Inserted data of filled in form stored on:

Website SQL Database Server
Data files All of these

Q2.Which language is used in this simulator for BackEnd development to store data on Database server

C++ Java
PHP option b & c

Q3.What happened first after Running PHP program:

Inserted Values assign in PHP varibles data loss
Data store MySQL run

Q4.SQL query used for:

connect to SQL database server
Manipulation in database tables.
a & b None of these

Q5.Connection Stablished by using information :

Username, Database name, Server Host
Only username
Username, Database name Database name

Q6.Query statment prepare in this simulator:

Insert data on SQL database server
print data on screen
both a & b None of these

Database Connection Activities



Progress



Step 1: PHP program has been executed for Data storing on SQL Database Server and
Inserted value of Form is Assigning in PHP variables
by using 'POST' method.






Progress



Step 2: Connection is preparing for connecting to SQL Database server
by using Host_Server, User_Name and Database_Name







Step 3: Finding error for connected to SQL Database Server.
if found any error like wrong user_name, password, database_name etc. it will be terminate.













Progress



Step 4:There is no error found now connection is established and
preparing query for insert Assigned values of variables in database.






Progress



Step 5:Prepared Query is Bindind.








Progress



Step 6: SQL query is Executing and data is inserting in connected SQL Database server.







Progress



Step 7: SQL query has been executed and data inserted on connected SQL Database server.








Step 8: All Step completed and finally Database Connection of SQL Server has been closed Successfully.











SQL Database Server

Name
Email
C.No
Gd
Dt_O_Birth
City
State
Orgn
QLF
Apd

PHP Source Code

/* Input value of Student is assigning in PHP variable by using 'POST method' */

$Name=$_POST['name'];   $email=$_POST['email'];
$number=$_POST['Contact'];  $gender=$_POST['Gender'];
$dob=$_POST['dob'];  $Addr=$_POST['Addr'];
$City=$_POST['City'];  $State=$_POST['State'];
$Country=$_POST['Country'];  $Qualification=$_POST['Qualification'];
$Applied=$_POST['Applied'];


/* Connect to Database by Host_Server, User_Name, Password and Database_Name */

$conn = new mysqlI('host_server','user_name','','database');


/* Connection Error Checking */

if($conn->connect_error)
{
die('Connection Failed : '.$conn->connect_error);
}


/*Query Prepaped and Assigning in $stmt variable,
If Connection Established Successfully to Database Server */

else {
$stmt = $conn->prepare("insert into table_name(name, email, contact, gender, dob, Addr, City,
State, Country, Qualification, Applied) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");


/* Insertion query of SQL Bindind */

$stmt->bind_param("sssssssssss",$Name, $email, $number, $gender, $dob,
$Addr, $City, $State, $Country, $Qualification, $Applied);


/* SQL query Executing and data is inserting....*/

$stmt->execute();


/* Data inserted Successfully in Database Now Connection is closing */

$stmt->close();
$conn->close();
}