0% found this document useful (0 votes)
2 views

PHP Form Handling

Uploaded by

harshathvb04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

PHP Form Handling

Uploaded by

harshathvb04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

FORM

HANDLING

PROGRAM:
HTML PAGE:
<html>
<head>
<title> PHP FORM</title>
</head>
<style>
body {
background-image: url('white.jpg') ;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;

}
</style>
<body ALIGN="center">
<form action ="registration.php" method="POST">
<center style="background-color:#000000">
<h1><font color="white" size="35"><b>SATHYABAMA</b> </font></h1>
<h1><font color="white"><b>INSTITUTE OF SCIENCE AND TECHNOLOGY</b></font></h1>
<H2><font color="white"><b> [REGISTRATION FORM] </b></font></H2>
<br>
</CENTER>
<br><br>
First Name: <input type="text" name="fname"><br><br>
Last Name: <input type="text" name="lname"><br><br>
E-mail Id: <input type="email" name="email" required><br><br>
Gender: <input type="radio" name="gender" value="male">Male
<input type="radio" name="gender" value="female">Female<br><br>
Phone Number: <input type="text" name="phno" maxlength="10"><br><br>
<input type="submit" name="submit" value="submit">
</p>
</form>
</body>
</html>

PHP PAGE:
<?php if (isset($_POST['submit'])):?>
<h1>Thank you for registering <?php echo $_POST['fname'];?> </h1>
<h4>You have been recorded as
<?php echo $_POST['fname'] .' ' . $_POST['lname'];?></h4>
<p>First Name: <?php echo $_POST['fname'];?><br><br>
Last Name: <?php echo $_POST['lname'];?><br><br>
E-mail Id: <?php echo $_POST['email'];?><br><br>
Gender:
<?php
$radioVal=$_POST["gender"];
if($radioVal=="male")
{
echo("Male");
}
else
{
echo("Female");
}
?><br> <br>
Phone Number: <?php echo $_POST['phno'];?>
</p>
<link rel="stylesheet" href="registration.css">
<?php endif; ?>

CSS PAGE:
body {
background-image: url('bg.jpg') ;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;

RESULT:
The program has been successfully executed.
OUTPUT

You might also like