STGpracticle 3

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

Student Registration Form

Registration Form Controls Code:


<style>
body
{
background-image: linear-gradient(to
left,#fac8ad,#f999a9,#ee8cff);
/*font-family: Arial, sans-serif;*/
}

.btn
{
background-color: #80f4ff;
color:#ffffff;
padding:12px 20px;
margin:10px;
border:none;
border-radius:4px;
cursor:pointer;
font-size: 25px;
transition: transform 0.2s ease-in-out;
}

.btn:hover{
background-color: #63effc;
transform: scale(1.1);
}
.gradient
{
background-image: linear-gradient(to
left,#f1a3fd,#c891fc,#a1c4ff);
width: 700px;
height:1000px;
padding:10px,80px;
border:none;
border-radius:10px;
}
.txt
{
width:300px;
height:40px;
padding:0px 12px;
border:none;
border-radius: 4px;
margin:20px;
box-sizing: border-box;
Student Registration Form
font-size: 20px;
}
.txtadd
{
width:300px;

height:130px;
padding:0px 12px;
border:none;
border-radius: 4px;
margin:20px;
box-sizing: border-box;
font-size: 20px;
}
form {
text-align: center; /*Center align the form */
color:#1a0034;
}

</style>
<!Doctype html>
<html>
<head>
<title>Student Registration Form</title>
</head>
<body>
<center>
<br>
<h1><font color=#590028 size="54">Student Registration
Form</font></h1>
<br><br><h2>
<div class="gradient">
<form method="POST" action="StudentData.php">
<br>
Name: <input type="text" name="txt1" value="" class="txt">
<br>
Rollno: <input type="text" name="txt2" value="" class="txt">
<br><br>
<div class="radio-group">
Gender: </pre>
<label><input type="radio" name="gender" value="Male">
Male</label>
<label><input type="radio" name="gender" value="Female">
Female</label>
<label><input type="radio" name="gender" value="Other">
Other</label>
Student Registration Form
</div>
<br>
Year: <select name="year" class="txt">
<option>1st Year</option>
<option>2nd Year</option>
<option>3rd Year</option>
</select>
<br>

Branch: <select name="branch" class="txt">


<option>Information Technology(IT)</option>
<option>Computer Technology(CM)</option>
<option>Electronics(EE)</option>
<option>Electronics & Telecommunication(EE)</option>
<option>Mechanical Engineering(ME)</option>
<option>Civil Engineering(CE)</option>
<option>Automobile Engineering(AE)</option>
<option>Polymer Engineering(PE)</option>
<option>Interior Designing(IDD)</option>
</select>
<br>
<div class="checkbox-group">
Courses:
<label><input type="checkbox" name="courses[]" value="C"> C</label>
<label><input type="checkbox" name="courses[]" value="C++"> C+
+</label>
<label><input type="checkbox" name="courses[]"
value="JAVA">JAVA</label>
<label><input type="checkbox" name="courses[]" value="PHP">
PHP</label>
<label><input type="checkbox"
name="courses[]"value="Python">Python</label>
<label><input type="checkbox" name="courses[]"value="Scripting">
Scripting</label>
</div>
<br>
Hobbies: <select name="hobbies[]" multiple="multiple"
class="txtadd">
<option>Sports</option>
<option>Arts</option>
<option>Reading</option>
<option>Singing</option>
<option>Dancing</option>
</select>
<br>
Student Registration Form
Address: <textarea name="txtarea" rows="8" cols="25"
class="txtadd"></textarea>
<br><br>
<center><input type="submit"name="sub" value="Submit"
class="btn"></center>
</h2></form>
</center></h1>
</div>
</body>
</html>

Submitted Data code:


<style>
body
{
background-image: linear-gradient(130deg,#ff662a, #ffd428,
#ff662a);
font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida
Grande', 'Lucida Sans', Arial, sans-serif
}
</style>
<!Doctype html>
<head>
<title>StudentData</title>
</head>
<body>
<center><h1><font color="#641700" size="40">Student
Data</font></h1></center>
</body>
</html>
<?php
/*
$name=$_POST['txt1'];
$age=$_POST['txt2'];
$year=$_POST['year'];
$branch=$_POST['branch'];
$address=$_POST['txtarea'];
$submit=$_POST['sub'];*/
#echo"<br><h1><center>Student Data</h1>";
Student Registration Form
if(isset($_POST['sub']))
{
if($_POST['txt1']&& $_POST['txt2'] && $_POST['gender'] &&
$_POST['year']&& $_POST['branch'] && $_POST['courses'] &&
$_POST['hobbies']&& $_POST['txtarea'] !="")
{
echo"<center><br><h1>Name: ",$_POST['txt1'],"</h2>";

echo"<center><h1>Rollno: ",$_POST['txt2'],"</h2>";

/*echo"<center><br><h1>Gender: ",$_POST['gender'],"</h2>";*/
$gen=$_POST['gender'];
echo"<center><h1>Gender is :",$gen."</h1>";

echo"<center><h1>Year: ",$_POST['year'],"</h2>";

echo"<center><h1>Branch: ",$_POST['branch'],"</h2>";

/*echo"<center><br><h1>Courses are: ",$_POST['txt1'],"</h2>";*/


$county=count($_POST['courses']);
echo"<h1>Total Selected Courses are:".$county."</h1>";
foreach($_POST['courses'] as $x)
{
echo"<center><h2>",$x,"</h2>";
}

echo"<center><h1>Hobbies are ","</h2>";


foreach($_POST['hobbies'] as $x)
echo"<h2>".$x."</h2>";
echo"<center><h1>Address: ",$_POST['txtarea'],"</h2>";

}
else
{
echo"<br><h2><center>Enter details properly</h2>";
}
}
?>
Student Registration Form
Student Registration Form

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy