You are on page 1of 3

206150307007 DCE-A SUHANI VAISHNAV

PRACTICAL – 18
AIM: Write two different PHP script to demonstrate passing
variables through a URL. (GET Method)

INPUT:-
<html>
<head>
<style>
body{
font-family: Calibri, Helvetica, sans-serif;
color:white;
}
.container {
width:700px;
padding: 25px;
background-color: #002147;
text-align:left;
}
input[type=text]{
width: 100%;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
border: none;
background: #f1f1f1;
}
input[type=text]:focus{
background-color: orange;
outline: none;
}
div {
padding: 10px 0;
}
hr {
order: 1px solid #f1f1f1;

3350702 DWPD Page | 96


206150307007 DCE-A SUHANI VAISHNAV

argin-bottom: 25px;
}
.registerbtn {
background-color: #4CAF50;
color: white;
padding: 16px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
opacity: 0.9;
}
.registerbtn:hover {
opacity: 1;
}
</style>
</head>
<body>
<form method="GET" action="p18.1.php">
<center><div class="container">
<center> <h1> Passing variables through a URL(GET Method) </h1>
</center>
<hr>
<label> Name </label>
<input type="text" name="name" placeholder= "name" size="15"
required />
<label>Phone :</label>
<input type="text" name="phone" placeholder="phone no." size="10"
required>
<label for="email">Email</label>
<input type="text" placeholder="Enter Email" name="email"
required>
<button type="submit" class="registerbtn">Submit</button>
</center>
</form>
</body>
</html>

3350702 DWPD Page | 97


206150307007 DCE-A SUHANI VAISHNAV

P18.1.php:-
<html>
<style>
body{
background-color:#32174d ;
color:white;
font-size:18px;
}
table{
width:500px;
}
table tr th{
padding:18px;
}
</style>
<body>
<center><div>
<table border=1>
<tr>
<th>
<h1><?php
echo "DETAILS";
?></h1>
</th>
</tr>
<tr>
<th>
<?php
$n=$_GET['name'];
$p=$_GET['phone'];
$e=$_GET['email'];
echo "NAME :- ".$n."<br/>";
echo "PHONE NO :- ".$p."<br/>";
echo "EMAIL :- ".$e."<br/>";
?>
</th>
</tr>

3350702 DWPD Page | 98

You might also like