Tech Archive

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

How to make Arithmetic Calculator in php?

<?php if(isset($_POST[‘num1’])){ $num1=$_POST[‘num1’]; } if(isset($_POST[‘num2’])){ $num2=$_POST[‘num2’]; } if(isset($_POST[‘add’])){ $result=$num1+$num2; } else if(isset($_POST[‘sub’])){ $result=$num1-$num2; } else if(isset($_POST[‘div’])){ $result=$num1/$num2; } else if(isset($_POST[‘mul’])){ $result=$num1*$num2; } ?> <html> <head> <title>Php Example</title> </head>
Read More