create file calc.php and put...
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
/////////////calc///////////////////////
/////Mailto:dwizofoz19@yahoo.co.uk////////
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
if ($action=="") {
echo "<card id=\"card1\" title=\"Calculator\">";
echo "
";
echo "Calculator
";
echo "Enter Value:
";
echo "<input emptyok=\"true\" name=\"no\" format=\"*n\" maxlength=\"255\" size=\"4\"/>";
echo "";
echo "
<anchor title=\"Square Root\">Square Root";
echo "<go href=\"calc.php?action=sqrt\" method=\"post\">";
echo "<postfield name=\"no\" value=\"\$no\"/>";
echo "</go>";
echo "</anchor>";
echo "
<anchor title=\"Cosine\">Cosine";
echo "<go href=\"calc.php?action=cosine\" method=\"post\">";
echo "<postfield name=\"no\" value=\"\$no\"/>";
echo "</go>";
echo "</anchor>";
echo "
<anchor title=\"Sine\">Sine";
echo "<go href=\"calc.php?action=sine\" method=\"post\">";
echo "<postfield name=\"no\" value=\"\$no\"/>";
echo "</go>";
echo "</anchor>";
echo "
<anchor title=\"Tangent\">Tangent";
echo "<go href=\"calc.php?action=tangent\" method=\"post\">";
echo "<postfield name=\"no\" value=\"\$no\"/>";
echo "</go>";
echo "</anchor>";
echo "
Other Calcs:
";
echo "<a href=\"calc.php?action=areacalc\">Area Calculator</a>
";
echo "<a href=\"calc.php?action=hypotcalc\">Hypotenuse Calculator</a>";
echo "";
echo "
© DrugsBunny";
echo "
<a title=\"Enter\" href=\"welcome.php?username=$username&password =$password\">Main Menu</a>";
echo "
";
echo "</p>";
echo "</card>"; }
///////////////////////////////Square Root//////////////////
if ($action=="sqrt") {
$no=$_POST["no"];
echo "<card id=\"card1\" title=\"Calculator\">";
echo "Square Root of $no is ";
echo sqrt($no);
echo "</card>"; }
///////////////////////////////Cosine//////////////////
if ($action=="cosine") {
$no=$_POST["no"];
echo "<card id=\"card1\" title=\"Calculator\">";
echo "Cosine of $no is ";
echo cos($no);
echo "</card>"; }
///////////////////////////////Sine////////////////////
if ($action=="sine") {
$no=$_POST["no"];
echo "<card id=\"card1\" title=\"Calculator\">";
echo "Sine of $no is ";
echo sin($no);
echo "</card>"; }
/////////////////////////////Tangent/////////////////////
if ($action=="tangent") {
$no=$_POST["no"];
echo "<card id=\"card1\" title=\"Calculator\">";
echo "Tangent of $no is ";
echo tan($no);
echo "</card>"; }
///////////////////////////Area Calcs////////////////////
if ($action=="areacalc") {
echo "<card id=\"card1\" title=\"Area Calc\">";
echo "
";
echo "<a href=\"calc.php?action=squarearea\">Square</a>
";
echo "<a href=\"calc.php?action=rectanglearea\">Rectangle</a>
";
echo "</p>";
echo "</card>"; }
/////////////////////////Square area//////////////////
if ($action=="squarearea") {
echo "<card id=\"card1\" title=\"Area Calc\">";
echo "
";
echo "Enter side:
<input emptyok=\"true\" name=\"sqside\" format=\"*n\"/>
";
echo "<anchor title=\"Go\">Go";
echo "<go href=\"calc.php?action=squarearea2\" method=\"post\">";
echo "<postfield name=\"sqside\" value=\"\$(sqside)\"/>";
echo "</go>";
echo "</anchor>";
echo "</p>";
echo "</card>"; }
if ($action=="squarearea2") {
echo "<card id=\"card1\" title=\"Area Calc\">";
echo "
";
$sqside=$_POST["sqside"];
$area=$sqside * $sqside;
echo "Area of square is:$area units";
echo "</p>";
echo "</card>"; }
///////////////////////Rectangle area//////////////////
if ($action=="rectanglearea") {
echo "<card id=\"card1\" title=\"Area Calc\">";
echo "
";
echo "Enter length:
<input emptyok=\"true\" name=\"rcl\" format=\"*n\" size=\"4\"/>
";
echo "Enter width:
<input emptyok=\"true\" name=\"rcw\" format=\"*n\" size=\"4\"/>
";
echo "<anchor title=\"Go\">Go";
echo "<go href=\"calc.php?action=rectanglearea2\" method=\"post\">";
echo "<postfield name=\"rcl\" value=\"$(rcl)\"/>";
echo "<postfield name=\"rcw\" value=\"$(rcw)\"/>";
echo "</go>";
echo "</anchor>";
echo "</p>";
echo "</card>"; }
if ($action=="rectanglearea2") {
$rcl=$_POST["rcl"];
$rcw=$_POST["rcw"];
$rectarea=$rcl * $rcw;
echo "<card id=\"card1\" title=\"Area Calc\">";
echo "
";
echo "Area of rectangle is:$rectarea units";
echo "</p>";
echo "</card>"; }
/////////////////////Hypot calc///////////////////////////
if ($action=="hypotcalc") {
echo "<card id=\"card1\" title=\"Hypotenuse Calc\">";
echo "
";
echo "X side:
";
echo "<input emptyok=\"true\" name=\"a\" size=\"4\"/>
";
echo "Y side:
<input emptyok=\"true\" name=\"b\" format=\"*n\" size=\"4\"/>
";
echo "<anchor title=\"Get hypotenuse\">Get hypotenuse";
echo "<go href=\"calc.php?action=hypotcalc2\" method=\"post\">";
echo "<postfield name=\"a\" value=\"$(a)\"/>";
echo "<postfield name=\"b\" value=\"$(
\"/>";
echo "</go>";
echo "</anchor>";
echo "</p>";
echo "</card>"; }
if ($action=="hypotcalc2") {
$a=$_POST[a];
$b=$_POST[b];
$c=hypot($a,$b);
echo "<card id=\"card1\" title=\"Hypotenuse Calc\">";
echo "
";
echo "The hypotenuse of ($a,$b) is $c";
echo "</p>";
echo "</card>"; }
?>
</wml></div>
then upload to your server then add the calc.php to your script.
works with all scripts... enjoy
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
/////////////calc///////////////////////
/////Mailto:dwizofoz19@yahoo.co.uk////////
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
if ($action=="") {
echo "<card id=\"card1\" title=\"Calculator\">";
echo "
";
echo "Calculator
";
echo "Enter Value:
";
echo "<input emptyok=\"true\" name=\"no\" format=\"*n\" maxlength=\"255\" size=\"4\"/>";
echo "";
echo "
<anchor title=\"Square Root\">Square Root";
echo "<go href=\"calc.php?action=sqrt\" method=\"post\">";
echo "<postfield name=\"no\" value=\"\$no\"/>";
echo "</go>";
echo "</anchor>";
echo "
<anchor title=\"Cosine\">Cosine";
echo "<go href=\"calc.php?action=cosine\" method=\"post\">";
echo "<postfield name=\"no\" value=\"\$no\"/>";
echo "</go>";
echo "</anchor>";
echo "
<anchor title=\"Sine\">Sine";
echo "<go href=\"calc.php?action=sine\" method=\"post\">";
echo "<postfield name=\"no\" value=\"\$no\"/>";
echo "</go>";
echo "</anchor>";
echo "
<anchor title=\"Tangent\">Tangent";
echo "<go href=\"calc.php?action=tangent\" method=\"post\">";
echo "<postfield name=\"no\" value=\"\$no\"/>";
echo "</go>";
echo "</anchor>";
echo "
Other Calcs:
";
echo "<a href=\"calc.php?action=areacalc\">Area Calculator</a>
";
echo "<a href=\"calc.php?action=hypotcalc\">Hypotenuse Calculator</a>";
echo "";
echo "
© DrugsBunny";
echo "
<a title=\"Enter\" href=\"welcome.php?username=$username&password =$password\">Main Menu</a>";
echo "
";
echo "</p>";
echo "</card>"; }
///////////////////////////////Square Root//////////////////
if ($action=="sqrt") {
$no=$_POST["no"];
echo "<card id=\"card1\" title=\"Calculator\">";
echo "Square Root of $no is ";
echo sqrt($no);
echo "</card>"; }
///////////////////////////////Cosine//////////////////
if ($action=="cosine") {
$no=$_POST["no"];
echo "<card id=\"card1\" title=\"Calculator\">";
echo "Cosine of $no is ";
echo cos($no);
echo "</card>"; }
///////////////////////////////Sine////////////////////
if ($action=="sine") {
$no=$_POST["no"];
echo "<card id=\"card1\" title=\"Calculator\">";
echo "Sine of $no is ";
echo sin($no);
echo "</card>"; }
/////////////////////////////Tangent/////////////////////
if ($action=="tangent") {
$no=$_POST["no"];
echo "<card id=\"card1\" title=\"Calculator\">";
echo "Tangent of $no is ";
echo tan($no);
echo "</card>"; }
///////////////////////////Area Calcs////////////////////
if ($action=="areacalc") {
echo "<card id=\"card1\" title=\"Area Calc\">";
echo "
";
echo "<a href=\"calc.php?action=squarearea\">Square</a>
";
echo "<a href=\"calc.php?action=rectanglearea\">Rectangle</a>
";
echo "</p>";
echo "</card>"; }
/////////////////////////Square area//////////////////
if ($action=="squarearea") {
echo "<card id=\"card1\" title=\"Area Calc\">";
echo "
";
echo "Enter side:
<input emptyok=\"true\" name=\"sqside\" format=\"*n\"/>
";
echo "<anchor title=\"Go\">Go";
echo "<go href=\"calc.php?action=squarearea2\" method=\"post\">";
echo "<postfield name=\"sqside\" value=\"\$(sqside)\"/>";
echo "</go>";
echo "</anchor>";
echo "</p>";
echo "</card>"; }
if ($action=="squarearea2") {
echo "<card id=\"card1\" title=\"Area Calc\">";
echo "
";
$sqside=$_POST["sqside"];
$area=$sqside * $sqside;
echo "Area of square is:$area units";
echo "</p>";
echo "</card>"; }
///////////////////////Rectangle area//////////////////
if ($action=="rectanglearea") {
echo "<card id=\"card1\" title=\"Area Calc\">";
echo "
";
echo "Enter length:
<input emptyok=\"true\" name=\"rcl\" format=\"*n\" size=\"4\"/>
";
echo "Enter width:
<input emptyok=\"true\" name=\"rcw\" format=\"*n\" size=\"4\"/>
";
echo "<anchor title=\"Go\">Go";
echo "<go href=\"calc.php?action=rectanglearea2\" method=\"post\">";
echo "<postfield name=\"rcl\" value=\"$(rcl)\"/>";
echo "<postfield name=\"rcw\" value=\"$(rcw)\"/>";
echo "</go>";
echo "</anchor>";
echo "</p>";
echo "</card>"; }
if ($action=="rectanglearea2") {
$rcl=$_POST["rcl"];
$rcw=$_POST["rcw"];
$rectarea=$rcl * $rcw;
echo "<card id=\"card1\" title=\"Area Calc\">";
echo "
";
echo "Area of rectangle is:$rectarea units";
echo "</p>";
echo "</card>"; }
/////////////////////Hypot calc///////////////////////////
if ($action=="hypotcalc") {
echo "<card id=\"card1\" title=\"Hypotenuse Calc\">";
echo "
";
echo "X side:
";
echo "<input emptyok=\"true\" name=\"a\" size=\"4\"/>
";
echo "Y side:
<input emptyok=\"true\" name=\"b\" format=\"*n\" size=\"4\"/>
";
echo "<anchor title=\"Get hypotenuse\">Get hypotenuse";
echo "<go href=\"calc.php?action=hypotcalc2\" method=\"post\">";
echo "<postfield name=\"a\" value=\"$(a)\"/>";
echo "<postfield name=\"b\" value=\"$(
echo "</go>";
echo "</anchor>";
echo "</p>";
echo "</card>"; }
if ($action=="hypotcalc2") {
$a=$_POST[a];
$b=$_POST[b];
$c=hypot($a,$b);
echo "<card id=\"card1\" title=\"Hypotenuse Calc\">";
echo "
";
echo "The hypotenuse of ($a,$b) is $c";
echo "</p>";
echo "</card>"; }
?>
</wml></div>
then upload to your server then add the calc.php to your script.
Comment