Tech Archive

How to Select Letter from dropdown and print array element?

<?php if(isset($_POST[‘btnsubmit’])) { $a_name=array(“Amit”,“Anil”,“Ajay”,“Atul”); $b_name=array(“Benu”,“Brijesh”,“Bipul”); $c_name=array(“Charu”,“Chadan”,“Chandu”); if($_POST[“personname”]==‘A’) foreach($a_name as $value) echo $value.“<br>”; if($_POST[“personname”]==‘B’) foreach($b_name as $value) echo $value.“<br>”; if($_POST[“personname”]==‘C’) foreach($c_name as $value) echo $value.“<br>”; } ?> <html> <head>
Read More

How to create Form Tag using php?

<html> <head> </head> <body> <table border=“1” width=“100%”> <tr> <td width=“20%”> <?php if(isset($_POST[‘btn’])) echo “Step 2”; elseif(isset($_POST[‘btn2’])) echo “Step 3”; else echo “Step 1”; ?> </td> <td width=“80%” rowspan=“3”>
Read More

How to Create Blank field validation using php?

<?php if(isset($_POST[‘btnsubmit’])) { if($_POST[‘userid’]==“”) $userid_msg=“Please Enter User ID”; if($_POST[‘password’]==“”) $password_msg=“Please Enter Password”; } ?> <html> <head> <title>Validating data from Server Side</title> </head> <body> <form name=“frm” method=“post” action=“”> <table
Read More

How to Create Restaurant Menu and Calculate Restaurants bill using PHP?

<?php if(isset($_POST[‘btn’])) { if(isset($_POST[‘chk1’])) { $one=$_POST[‘chk1’]; $t_c=$_POST[‘coffee’]*$_POST[‘Coffee_rate’]; } else { $t_c=0; $one=0; } if(isset($_POST[‘chk2’])) { $two=$_POST[‘chk2’]; $t_cd=$_POST[‘cold_drink’]*$_POST[‘Cold_drink_rate’]; } else { $t_cd=0; $two=0; } if(isset($_POST[‘chk3’])) { $three=$_POST[‘chk3’]; $t_p=$_POST[‘pizza’]*$_POST[‘Pizza_rate’]; }
Read More

How to Create Registration form in PHP?

<html> <head> <title>PHP Example</title> </head> <body> <form name=”frm” action=”” method=”post”> <table border=’1′><tr> <td>First Name:</td> <td><input type=”text” name=”fname”></td> </tr> <tr> <td>Last Name:</td> <td><input type=”text” name=”lname”></td> </tr> <tr> <td>Gender:</td> <td><input
Read More