Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Practical 13

AIM:write a HTML page that contain textbox,submit/reset button,Write PHP program to display this
information and also store into text file.

input:

expe13.php:

<html>

<head>

<title>Exp13</title>

</head>

<body>

<form method='POST'>

First name : <input type="text" name="firstname" id="firstname"><br><br>

Last name : <input type="text" name="lastname" id="lastname"><br><br>

Email : <input type="text" name="email" id="mail"><br><br>

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

</form>

<?php

if($_SERVER['REQUEST_METHOD']=='POST')

$firstname = $_POST['firstname'];

$lastname = $_POST['lastname'];

$mail = $_POST['email'];

200130111058
$data="Your first name : $firstname\nYour Last name : $lastname\nYour mail : $mail\n\n";

$file=fopen('info.txt','a+');

fwrite($file,$data);

fclose($file);

echo "<h3> Your informations are in info.txt file</h3>";

?>

</body>

</html>

Output:

200130111058
Conclusion:

Sign:

200130111058

You might also like