SlideShare a Scribd company logo
1 of 2
EXPERIMENT - 6
CODE:
P6.html
<html>
<head>
<title>Order Form</title>
<script type="text/javascript" >
function loadjson()
{
var json = '{"h1": "<b><h2><pre>Select the items
: Quantity</pre></b></h2>"}';
var obj = JSON.parse(json);
document.getElementById("heading").innerHTM
L=obj.h1;
document.getElementById("heading").innerText=
obj.h1;
}
</script>
</head>
<body onload="loadjson();">
<form method="POST"
action="http://localhost/p6.php">
User :
<input type="text" name="mname" size=30 />
<br/>
<label id="heading" ></label>
<table>
<TR>
<TD>
<input type="checkbox" name="option1"
checked="checked"/>
<label id="chk1">Four 100 watt bulbs for Rs.
20.39 </label>
</TD>
<TD>
<input type="text" name="VAL1" size=2 />
</TD>
</TR>
<TR>
<TD>
<input type="checkbox" name="option2" />
<label id="chk2">Eight 100watt bulbs for Rs
40.20 </label></TD>
<TD>
<input type="text" name="VAL2" size=2/>
</TD>
</TR>
<TR>
<TD>
<input type="checkbox" name="option3" />
<label id="chk3">Four 100watt long life bulbs for
Rs. 30.95 </label>
</TD>
<TD>
<input type="text" name="VAL3" size=2/>
</TD>
</TR>
<TR>
<TD>
<input type="checkbox" name="option4" />
<label id="chk4">Eight 100watt long life bulbs
for Rs 70.49 </label><br/>
</TD>
<TD>
<input type="text" name="VAL4" size=2/>
</TD>
</TR>
</table>
<input type="radio" name="paymode"
value="visa" checked="checked" /> VISA <br/>
<input type="radio" name="paymode"
value="mcard"/> MASTER CARD <br/>
<input type="radio" name="paymode"
value="discover"/> DISCOVER <br/>
<input type="submit" id="bt" value="submit"/>
<input type="reset" value="Reset Order" />
</form>
</body>
</html>
p6.php
<html>
<head>Display Form</head>
<body>
<?php
$name=$_POST["mname"];
$mode=$_POST["paymode"];
$item1=0;
$item2=0;
$item3=0;
$item4=0;
$price1=20.39;
$price2=30.95;
$price3=40.20;
$price4=70.49;
if(isset($_POST['option1']))
$item1=$_POST['VAL1'];
if(isset($_POST['option2']))
$item2=$_POST['VAL2'];
if(isset($_POST['option3']))
$item3=$_POST['VAL3'];
if(isset($_POST['option4']))
$item4=$_POST['VAL4'];
$total1=$item1*$price1;
$total2=$item2*$price2;
$total3=$item3*$price3;
$total4=$item4*$price4;
$total=$total1+$total2+$total3+$total4;
$total+=($total*13.5)/100;
print("</br> User Name:$name");
?>
<h3> You have ordered following items</h3>
<table border=1>
<tr><th>Item</th><th>Qty</th><th>Price</th><th>Total</th></tr>
<tr><td>Four 100 watt bulbs for Rs. 20.39</td>
<td><?php print("$item1");?></td><td><?php print("$price1");?></td>
<td><?php print("$total1");?></td></tr>
<tr><td>Eight 100watt bulbs for Rs 40.20</td>
<td><?php print("$item2");?></td><td><?php print("$price2");?></td><td><?php
print("$total2");?></td></tr>
<tr><td>Four 100watt long life bulbs for Rs. 30.95</td><td><?php print("$item3");?></td><td><?php
print("$price3");?></td><td><?php print("$total3");?></td></tr>
<tr><td>Eight 100watt long life bulbs for Rs 70.49</td><td><?php print("$item4");?></td><td><?php
print("$price4");?></td><td><?php print("$total4");?></td></tr>
</table>
</br></br>
<?php print("Total bill including 13.5% tax:<b> $total </b>");?>
<?php print("payment mode:<b> $mode </b>");?>
</body>
</html>
OUTPUT:

More Related Content

What's hot (8)

Membuat Form Login
Membuat Form Login Membuat Form Login
Membuat Form Login
 
Going with style: Themes and apps for Magento Go
Going with style: Themes and apps for Magento GoGoing with style: Themes and apps for Magento Go
Going with style: Themes and apps for Magento Go
 
Text 1
Text 1Text 1
Text 1
 
Java script events
Java script  eventsJava script  events
Java script events
 
Javascript 2
Javascript 2Javascript 2
Javascript 2
 
Url&doc html
Url&doc htmlUrl&doc html
Url&doc html
 
Growing jQuery
Growing jQueryGrowing jQuery
Growing jQuery
 
HTML Powerpoint-Jeffrey C. Johnson III
HTML Powerpoint-Jeffrey C. Johnson IIIHTML Powerpoint-Jeffrey C. Johnson III
HTML Powerpoint-Jeffrey C. Johnson III
 

Similar to Exp6

Assignment4
Assignment4Assignment4
Assignment4
H K
 
Chapter 6 Getting Data from the Client (1).pptx
Chapter 6 Getting Data from the Client (1).pptxChapter 6 Getting Data from the Client (1).pptx
Chapter 6 Getting Data from the Client (1).pptx
AhmedKafi7
 
I211 – Information Infrastructure IILecture 20TodayCGI.docx
I211 – Information Infrastructure IILecture 20TodayCGI.docxI211 – Information Infrastructure IILecture 20TodayCGI.docx
I211 – Information Infrastructure IILecture 20TodayCGI.docx
florriezhamphrey3065
 

Similar to Exp6 (20)

Java(Java_Servlet_programs_examples).pdf
Java(Java_Servlet_programs_examples).pdfJava(Java_Servlet_programs_examples).pdf
Java(Java_Servlet_programs_examples).pdf
 
14922 java script built (1)
14922 java script built (1)14922 java script built (1)
14922 java script built (1)
 
Practica n° 7
Practica n° 7Practica n° 7
Practica n° 7
 
Web Application in java.pptx
Web Application in java.pptxWeb Application in java.pptx
Web Application in java.pptx
 
Html server control - ASP. NET with c#
Html server control - ASP. NET with c#Html server control - ASP. NET with c#
Html server control - ASP. NET with c#
 
Html To JSP
Html To JSPHtml To JSP
Html To JSP
 
Assignment4
Assignment4Assignment4
Assignment4
 
HTML SERVER CONTROL - ASP.NET WITH C#
HTML SERVER CONTROL  - ASP.NET WITH C#HTML SERVER CONTROL  - ASP.NET WITH C#
HTML SERVER CONTROL - ASP.NET WITH C#
 
Chapter 6 Getting Data from the Client (1).pptx
Chapter 6 Getting Data from the Client (1).pptxChapter 6 Getting Data from the Client (1).pptx
Chapter 6 Getting Data from the Client (1).pptx
 
TYCS Ajax practicals sem VI
TYCS Ajax practicals sem VI TYCS Ajax practicals sem VI
TYCS Ajax practicals sem VI
 
Java script cookies
Java script   cookiesJava script   cookies
Java script cookies
 
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
 
Web 11 | AJAX + JSON + PHP
Web 11 | AJAX + JSON + PHPWeb 11 | AJAX + JSON + PHP
Web 11 | AJAX + JSON + PHP
 
WEB DESIGN PRACTICLE bca
WEB DESIGN PRACTICLE bcaWEB DESIGN PRACTICLE bca
WEB DESIGN PRACTICLE bca
 
YASH HTML CODES
YASH HTML CODESYASH HTML CODES
YASH HTML CODES
 
YASH HTML CODE
YASH HTML CODE YASH HTML CODE
YASH HTML CODE
 
JS1.pdf
JS1.pdfJS1.pdf
JS1.pdf
 
計算機概論20161212
計算機概論20161212計算機概論20161212
計算機概論20161212
 
Tutorial asp.net
Tutorial  asp.netTutorial  asp.net
Tutorial asp.net
 
I211 – Information Infrastructure IILecture 20TodayCGI.docx
I211 – Information Infrastructure IILecture 20TodayCGI.docxI211 – Information Infrastructure IILecture 20TodayCGI.docx
I211 – Information Infrastructure IILecture 20TodayCGI.docx
 

Recently uploaded

Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted KitAbortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh +966572737505 get cytotec
 
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get CytotecAbortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
yulianti213969
 
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
wsppdmt
 
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
acoha1
 
Displacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second DerivativesDisplacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second Derivatives
23050636
 
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotecAbortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
wsppdmt
 

Recently uploaded (20)

RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATIONCapstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted KitAbortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
 
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get CytotecAbortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
 
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
 
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
 
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
 
Displacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second DerivativesDisplacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second Derivatives
 
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotecAbortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
 
jll-asia-pacific-capital-tracker-1q24.pdf
jll-asia-pacific-capital-tracker-1q24.pdfjll-asia-pacific-capital-tracker-1q24.pdf
jll-asia-pacific-capital-tracker-1q24.pdf
 
Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting Techniques
 
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
 
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarjSCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...
Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...
Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...
 

Exp6

  • 1. EXPERIMENT - 6 CODE: P6.html <html> <head> <title>Order Form</title> <script type="text/javascript" > function loadjson() { var json = '{"h1": "<b><h2><pre>Select the items : Quantity</pre></b></h2>"}'; var obj = JSON.parse(json); document.getElementById("heading").innerHTM L=obj.h1; document.getElementById("heading").innerText= obj.h1; } </script> </head> <body onload="loadjson();"> <form method="POST" action="http://localhost/p6.php"> User : <input type="text" name="mname" size=30 /> <br/> <label id="heading" ></label> <table> <TR> <TD> <input type="checkbox" name="option1" checked="checked"/> <label id="chk1">Four 100 watt bulbs for Rs. 20.39 </label> </TD> <TD> <input type="text" name="VAL1" size=2 /> </TD> </TR> <TR> <TD> <input type="checkbox" name="option2" /> <label id="chk2">Eight 100watt bulbs for Rs 40.20 </label></TD> <TD> <input type="text" name="VAL2" size=2/> </TD> </TR> <TR> <TD> <input type="checkbox" name="option3" /> <label id="chk3">Four 100watt long life bulbs for Rs. 30.95 </label> </TD> <TD> <input type="text" name="VAL3" size=2/> </TD> </TR> <TR> <TD> <input type="checkbox" name="option4" /> <label id="chk4">Eight 100watt long life bulbs for Rs 70.49 </label><br/> </TD> <TD> <input type="text" name="VAL4" size=2/> </TD> </TR> </table> <input type="radio" name="paymode" value="visa" checked="checked" /> VISA <br/> <input type="radio" name="paymode" value="mcard"/> MASTER CARD <br/> <input type="radio" name="paymode" value="discover"/> DISCOVER <br/> <input type="submit" id="bt" value="submit"/> <input type="reset" value="Reset Order" /> </form> </body> </html> p6.php <html> <head>Display Form</head> <body> <?php $name=$_POST["mname"]; $mode=$_POST["paymode"]; $item1=0; $item2=0; $item3=0; $item4=0; $price1=20.39; $price2=30.95; $price3=40.20; $price4=70.49; if(isset($_POST['option1'])) $item1=$_POST['VAL1']; if(isset($_POST['option2'])) $item2=$_POST['VAL2']; if(isset($_POST['option3'])) $item3=$_POST['VAL3']; if(isset($_POST['option4'])) $item4=$_POST['VAL4']; $total1=$item1*$price1;
  • 2. $total2=$item2*$price2; $total3=$item3*$price3; $total4=$item4*$price4; $total=$total1+$total2+$total3+$total4; $total+=($total*13.5)/100; print("</br> User Name:$name"); ?> <h3> You have ordered following items</h3> <table border=1> <tr><th>Item</th><th>Qty</th><th>Price</th><th>Total</th></tr> <tr><td>Four 100 watt bulbs for Rs. 20.39</td> <td><?php print("$item1");?></td><td><?php print("$price1");?></td> <td><?php print("$total1");?></td></tr> <tr><td>Eight 100watt bulbs for Rs 40.20</td> <td><?php print("$item2");?></td><td><?php print("$price2");?></td><td><?php print("$total2");?></td></tr> <tr><td>Four 100watt long life bulbs for Rs. 30.95</td><td><?php print("$item3");?></td><td><?php print("$price3");?></td><td><?php print("$total3");?></td></tr> <tr><td>Eight 100watt long life bulbs for Rs 70.49</td><td><?php print("$item4");?></td><td><?php print("$price4");?></td><td><?php print("$total4");?></td></tr> </table> </br></br> <?php print("Total bill including 13.5% tax:<b> $total </b>");?> <?php print("payment mode:<b> $mode </b>");?> </body> </html> OUTPUT: