web技術實驗報告_第1頁
web技術實驗報告_第2頁
web技術實驗報告_第3頁
web技術實驗報告_第4頁
web技術實驗報告_第5頁
已閱讀5頁,還剩3頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

實驗報告(2014/2015學年第2學期)課程名稱 Web技術實驗名稱 Web服務端腳本編寫實驗時間2015年05月13日指導單位南京郵電大學計算機學院指導教師 韓京宇學生姓名陶飛班級學號B13040932學院(系)計算機軟件專業軟件工程實驗報告實驗名稱 Web服務端腳本編寫指導教師 韓京宇實驗類型 上機 實驗學時 2實驗時間 2015-05-13一、實驗目的(1)通過上機實踐,熟悉Apache服務器的安裝和使用方法。(2)掌握PHP腳本語言,熟練運用PHP語言進行服務器端編程。二、實驗環境硬件:微機軟件:Apache,PHP模塊編輯器:vim或者gedit三、實驗內容.顯示一個圖書售賣界面,主要包括以下內容HTML標題“Welcomtobookseller”。(2)頁面內容第一行黑體顯示"Youarewelcomevo(3)標簽提示“pleaseinputyourname”,并創建輸入框。(4)標簽提示“pleaseinputyouraddress”,并創建輸入框。(5)標簽提示“pleaseinputyourzip”,并創建輸入框。(6)黑體顯示uPleasefillinthequantityfieldofthefollowingform".(7)表格分成四列,分別是“boook”,"publisher”「price”,"quantity",其中包含信息如表格所示quantity采用輸入框輸入。(9)顯示“paymentmethod”(10)用單選按鈕顯示三個支付方式選項“cash”,"cheque”,"creditcard”。(11)顯示兩個標準按鈕,“submit”按鈕和“reset”按鈕。2當用戶輸完各個內容并按下“submit”按鈕后,通過腳本生成新的界面。其中包含以下內容customernamecustomeraddresscustomerzip(4)以表格形式顯示訂購圖書信息,包括四列“book”,“publisher”,“price",“totalcost",其中total通過腳本動態計算生成。未購買的圖書不顯示。(5)計算并顯示“(名字)hasbought(數量)books(6)計算并顯示“(名字)paid(總額)(7)根據用戶的選擇方式顯示“paidby(支付方式)3將用戶購買信息存入到文件當中,每個客戶包含三行信息,即2中的(5)(6)(7)三句話。4如果用戶按的是“重置按鈕。則清楚所有的輸入信息。四、實驗過程<htmlxmlns><head><title>Welcometobookseller</title></head><body><formaction=11http://localhost/qwe.php11method=Hpostn><hl>Youarewlcome</hl><table><tr><td>pleaseinputyourname</td><td><inputtype=HtextHname=HnameHsize=n30H/></td></tr><tr><td>pleaseinputyouraddress</td><tdxinputtype=''text''name=''street''size=''30''/x/td></tr><tr><td>pleaseinputyourzip</td><tdxinputtype=Htextnname=McityMsize=n30f7x/td></tr></table><p/><tableborder=11borderf1><h2>pleaseHllinthequantityfieldofthefollowingform</h2><tr><th>book</th><th>publisher</th><th>price</th><th>quantity</th></tr><tr><td>Webtechnology</td><td>Springerpress</td><td>$5.0</td><tdalign=ncenterM><inputtype=HtextHname=HwebHsize=n3H/></td></tr><tr><td>mathematics</td><td>ACMpress</td><td>$6.2</td><tdalign=HcenterH><inputtype=ntextnname=Hmathnsize=H3nx/td></tr><tr><td>principleofOS</td><td>Sciencepress</td><td>$10</td><tdalign=Hcentern><inputtype=ntextHname=HOSnsize=H3nx/td></tr><tr><td>Theoryofmatrix</td><td>Higheducationpress</td><td>$7.8</td><tdalign=Hcentern><inputtype=ntextHname=''matrix“size=n3nx/td></tr></table><p/><h3>PaymentMethod</h3><p><input type=''radio'' name=''payment'' value=''Cash''checked=ncheckedf7>Cash<br/><inputtype=''radio''name=''payment''value=''Cheque''/>Cheque<br/><inputtype=HradioHname=11paymentf1value=nCreditCard”/>CreditCard<br/xbr/><inputtype=nsubmitHvalue=HSubmitOrderf7><inputtype=nresetHvalue=nClearOrderFormf7></p></form></body></html><html><head><title>realrootsofaquadraticequation</title></head><body><scripttype=11text/javascript1f><!--vara=prompt(nwhatisthevalueofJ'');varb=prompt。'whatisthevalueof'b'\n''J'');varc=prompt,whatisthevalueofJ'');vard=b*b-4.0*a*c;if(d<0)document.write(nErrorInput!<br/>n);else{varroot_part=Math.sqrt(d);vardenom=2.0*a;varrootl=(-b+root_part)/denom;varroot2=(-b?root_part)/denom;document.write(ffThefirstrootis:f\rootl/f<br/>H);document.write(11Thesecondrootis:'\root2Jvbr/>'');)〃■,></script></body></html><htmlxmlns><head><title>Processtheqwe.htmlform</title></head><body><?php$web=$_POST[nwebn];$math=$_POST[Hmathn];$OS=$_POST[nOSn];$matrix=$_POST[11matrix11];$name=$_POST[HnameH];$street=$_POST[11streetn];$city=$_POST[ncityn];$payment=$POST'payment''];$web_cost=5.0*$web;$math_cost=6.2*$math;$OS_cost=10*$OS;$matrix_cost=7.8*$matrix;$total_price=$web_cost+$math_cost+$OS_cost+$matrix_cost;$total_items=$web+$math+$OS+$matrix;?><h4>Custormer:</h4><?phpprint(H$name<br/>$street<br/>$city<br/>'');?><p/><p/><tableborder=HborderH><caption>OrderInformation</capation><tr><th>Book</th><th>Publisher</th><th>Price</th><th>TotalCost</th></tr><tralign=ncenterH><td>Webtecohnology</td><td>Springerpress</td><td>$5.0</td><td><?phpprintf(H$%42f"$web_cost);?>v/td></tr><tralign=Hcentern><td>mathematics</td><td>ACMpress</td><td>$6.2</td><tdx?phpprintf(H$%4.2f"$math_cost);?>v/td></tr><tralign=ncentern><td>principleofOS</td><td>Sciencepress</td><td>$10</td><tdx?phpprintf(H$%4.2ff1,$OS_cost);?></td></tr><tralign=Hcentern><td>Theoryofmatrix</td><td>Higheductionpress</td><td>$7<8</td>vtd>v?phpprintf(''$%4?2f'\$matrixcost);?x/td></tr></table><p/><p/><?ph

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論