Fat Exam: Web Technologies

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

FAT EXAM

WEB TECHNOLOGIES

Name:A.sasidhar reddy

Reg no:16mis1122

1.code:

<html>

<head>

<body>

<table border="4" cell padding="4">

<td>A</td>

<td>BC</td>

<td>B</td>

<td>D</td>

<td>faker(B)</td>

<td>faker(c)</td>

<td>faker(flex)</td>
Output:

b.code:
<html>

<head>

<title>

student deatils</title>

</head>

<body>

<form action=2.php method="POST">

student id:<input type="text" name="student" id="fn" ><br>

student name:<input type="text" name="name" id="ln" ><br>

student address:<input type="text" name="address" id="cn" ><br>

student grade for course 100:<input type="url" name="grade" ><br>

student grade for course 100:<input type="text" name="grade" ><br>

<input type="submit" value="submit" >

</form>

</body>

</html>
Php code:

<?php

$host='localhost';

$user='root';

$pass='';

$db='list';

$a=filter_input(INPUT_POST,'student_id');

$b=filter_input(INPUT_POST,'student_name');

$c=filter_input(INPUT_POST,'student_address');

$d=filter_input(INPUT_POST,'student_grade_for_course_100');

$e=filter_input(INPUT_POST,'student_grade_for_course_101');

$con=new mysqli($host,$user,$pass,$db);

if($con->connect_error)

die("Connection failed: " . $con->connect_error);

$sql="INSERT INTO
sasi(student_id,student_name,student_address,student_grade_for_course_100,student_grade_for_cou
rse_101) VALUES ('$a','$b','$c','$d','$e')";

if ($con->query($sql) === TRUE)

echo "Record Inserted successfully";


}

else

echo "Error: " . $sql . "<br>" . $con->error;

$con->close();

?>

Output:

You might also like