php_sem_II_prog
php_sem_II_prog
HTML file :
<html>
<body>
<form action="slip21_2_1.php" method="get">
<center>
<b>Select font style :</b><input type=text name=s1> <br>
<b>Enter font size : </b><input type=text name=s><br>
<b>Enter font color : </b><input type=text name=c><br>
<b>Enter background color :</b> <input type=text name=b><br>
<input type=submit value="Next">
</center>
</form>
</body>
</html>
<label for="username">Username:</label>
<label for="password">Password:</label>
</form>
<?php
$correctUsername = "admin";
$correctPassword = "password";
$username = $_POST['username'];
$password = $_POST['password'];
// Check if the submitted username and password match the correct ones
echo "<form>";
echo "</form>";
} else {
?>
Setb_2
HTML file :
<html>
<body>
<form action="slip18_2_1.php" method="get">
<center> <h2>Enter Enployee Details :</h2> <br>
<table>
<tr> <td><b>Emp no :</b></td> <td><input type=text name=eno></td> </tr>
<tr> <td><b> Name :</b></td> <td><input type=text name=enm></td> </tr>
<tr> <td><b>Address :</b></td> <td><input type=text name=eadd></td>
</tr>
</table>
<br> <input type=submit value=Show name=submit>
</center>
</form>
</body>
</html>
<?php
session_start();
$eno = $_GET['eno'];
$enm = $_GET['enm'];
$eadd = $_GET['eadd'];
$_SESSION['eno'] = $eno;
$_SESSION['enm'] = $enm;
$_SESSION['eadd'] = $eadd;
?>
<html>
<body>
<table>
<tr><td>Basic : </td><td><input type="text" name="e1"></td><tr>
<tr><td>DA : </td><td><input type="text" name="e2"></td></tr>
<tr><td>HRA : </td><td><input type="text" name="e3"></td></tr>
<tr><td></td><td><input type="submit" value=Next></td></tr>
</table>
</center>
</form>
</body>
</html>
$total = $e1+$e2+$e3;
echo "<h2>Total Of Earnings Is : ".$total."</h2>";
?>
Setc
first.php
<html>
<body>
<table border="1">
<tr>
<td>customer Name:-</td>
<tr><td>customer address:-</td>
</tr> <tr><td></td>
</tr>
</table>
</form></body></html>
second.php
<html>
<body>
<?php
setCookie('name',$_POST["name"]);
setCookie('ph-no',$_POST["ph-no"]);
setCookie('address',$_POST["address"]);
echo"Hello".$_POST["name"]."!Enter Details....<br>";
?>
<table border="1">
</table>
</form>
</body>
</html>
third.php
<html>
<body>
<?php
echo "<tr><td>";
echo"customerName:".$_COOKIE["name"]."<br>";
echo "</tr></td>";
echo "<tr><td>";
echo"customer phone:-".$_COOKIE["ph-no"]."<br>";
echo "</tr></td>";
echo "<tr><td>";
echo"Studcustomerent address:-".$_COOKIE["address"]."<br>";
echo "</tr></td>";
echo "<tr><td>";
echo "</tr></td>";
echo "<tr><td>";
echo"pname:".$_REQUEST["pname"];echo "</tr></td>";
echo "<tr><td>";
echo"qty:".$_REQUEST["qty"];echo "</tr></td>";
echo "<tr><td>";
echo"rate:".$_REQUEST["rate"];echo "</tr></td>";
echo "</table>";
if(isset($_POST['submit']))
$qty=(int)$_POST['qty'];
$rate=(int)$_POST['rate'];
$total = $qty*$rate;
echo"Total=".$total;
?>
</body>
</html>