php代码
<html> <head> <title>caculator</title> </head> <body> <form name="myform" method="POST"> <tr> <script language = "javascript"> </script> <td><input type="text" name="text1"/></td><br/> <td><input type="text" name="sign" value="+"/<?$_GET['add']?></td><br/> <td><input type="text" name="text2"/></td><br/> <td><input type="text" name="text3"/></td><br/> <td><input type="button" name="count" value="="/></td><br/> <td><input type="text" name="equals"/></td><br/> <td><input type="reset" name="reset"/></td><br/> </tr> <tr> <script language = "javascript"> function count(text3){ var text1 = parseint(document.form.text1.value); var text2 = parseint(document.form.text2.value); } switch(text3){ case 0: document.form.text3.value = text1 + text2; break; case 1: document.form.text3.value = text1 - text2; break; case 2: document.form.text3.value = text1 * text2; break; case 3: document.form.text3.value = text1 / text2; break; default(text3 = text1/text2!=0){ document.form.text3.value = text1/text2; } } </script> <td><input type="text" name="text1"/></td><br/> <td><input type="text" name="sign" value="-"/><?$_GET['sub']?></td><br/> <td><input type="text" name="text2"/></td><br/> <td><input type="text" name="text3"/></td><br/> <td><input type="button" name="count" value="="/></td><br/> <td><input type="text" name="equals"/></td><br/> <td><input type="reset" name="reset"/></td><br/> </tr> <tr> <script language = "javascript"> </script> <td><input type="text" name="text1"/></td><br/> <td><input type="text" name="sign" value="*"/><?$_GET['mul']?></td><br/> <td><input type="text" name="text2"/></td><br/> <td><input type="text" name="text3"/></td><br/> <td><input type="button" name="count" value="="/></td><br/> <td><input type="text" name="equals"/></td><br/> <td><input type="reset" name="reset"/></td><br/> </tr> <tr> <script language = "javascript"> </script> <td><input type="text" name="text1"/></td><br/> <td><input type="text" name="sign" value="/"/><?$_GET['p']?></td><br/> <td><input type="text" name="text2"/></td><br/> <td><input type="text" name="text3"/></td><br/> <td><input type="button" name="count" value="="/></td><br/> <td><input type="text" name="equals"/></td><br/> <td><input type="reset" name="reset"/></td><br/> </tr> </form> <?php class calculate{ pbulic $text1; public $text2; public $text3; function add($text1,$text2){ $text3 = $text1 + $text2; $this->text1=$text1; $this->text2=$text2; echo "$_GET[add]"; } function sub($text1,$text2){ $text3 = $text1 - $text2; $this->text1=$text1; $this->text2=$text2; echo "$_GET[sub]"; } function mul($text1,$text2){ $text3 = $text1 * $text2; $this->text1=$text1; $this->text2=$text2; echo "$_GET[mul]"; } function p($text1,$text2){ $text3 = $text1 / $text2; $this->text1=$text1; $this->text2=$text2; echo "$_GET[p]"; } function getresult(){ echo $text3 = ($text1 + $text2). ".$_GET[add]"; echo $text3 = ($text1 + $text2). ".$_GET[sub]"; echo $text3 = ($text1 + $text2). ".$_GET[mul]"; echo $text3 = ($text1 + $text2). ".$_GET[p]"; } } ?> </body> </html>
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
刺客信條陰影:貝殼謎語解決方案
2 週前ByDDD
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

Atom編輯器mac版下載
最受歡迎的的開源編輯器

ZendStudio 13.5.1 Mac
強大的PHP整合開發環境

DVWA
Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

WebStorm Mac版
好用的JavaScript開發工具

Safe Exam Browser
Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。