<html> <head> <title>Submitting Form Information</title> </head> <body> <form name="html" action="ex1output.php" method="post"> <table border=5 cellspacing=0 cellpadding=3> <tr><td> Customer's Name: <td> <input type="text" name="name"> <tr><td> Item Bought: <td> <select name="item"> <option >Grocery Package 1</option> <option >Grocery Package 2</option> <option >Grocery Package 3</option> <option>Grocery Package 4</option> </select> <tr><td> Quantity: <td> <input type="text" name="quant"> <tr><td> Mode of Payment: <td> <input type="radio" name="rad1"><FONT SIZE=3>Cash</FONT></input> <input type="radio" name="rad2"><FONT SIZE=3>Credit Card</FONT> <input type="radio" name="rad3"><FONT SIZE=3>Cash On Delivery</FONT> <tr><td> Discount Types: <td> <input type="checkbox" name="check1" value=1><FONT SIZE=3>Senior Citizen</FONT> <input type="checkbox" name="check2" value=2><FONT SIZE=3>Membership Card</FONT> <input type="checkbox" name="check3" value=3><FONT SIZE=3>Photo Values</FONT> <tr><td colspan=2 align=right> <input type="reset" value="Reset"> <tr><td colspan=2 align=left> <input type="submit" value="Submit"> </table> </form> </body> </html>
<html> <head><title>Output</title> </head> <body> <?php $name= $_POST[name]; $Item = $_POST[item]; $quant= $_POST[quant]; if($_POST['item'] == 1){ $_POST['item'] = 'Grocery Package 1'; }else if($_POST['item'] == 2){ $_POST['item'] = 'Grocery Package 2'; }else if($_POST['item'] == 3){ $_POST['item'] = 'Grocery Package 3'; }else if($_POST['item'] == 4){ $_POST['item'] = 'Grocery Package 4'; }; ?> <table border=10 cellspacing=0 cellpadding=3> <tr><td width="78">Name <td width="262"> <?=$name;?> <tr><td>Item Bought <td> <?=$Item;?> <tr><td>Quantity <td> <?=$quant;?> </table> </body> </html>
$name= $_POST[name]; $Item = $_POST[item]; $quant= $_POST[quant];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)