Server IP : 172.16.15.8 / Your IP : 3.135.190.244 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/idetonyeaku/www/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<!-- File: passcalculator.php Assignment: 2 Part: d Due: Feb. 19, 2018 Author: Ikechukwu Etonyeaku Goal: Based on the general calculator in Pages 47-49, secure the Web pages by adding a login page with the password of hw2d to access the tool, and also add the additional operations of modulus (a%b) and power (ab) to the operation form. --> <?php session_start(); ?> <?php $pass = $_SESSION['psw']; if($pass != "hw2d") print "Sorry wrong password buddy."; else { ?> <HTML> <style> body { border: 2px solid black; padding: 25px; background:url(http://www.avatarys.com/var/albums/SPORT-IMAGES-%26-BACKGROUNDS/Sport-Logos/English-Premier-League-Logos/1920x1080-Cool-Soccer-Logos/Ac%20milan%20logo%20football%20Cool%20Soccer%20Wallpapers%201920x1080.jpg?m=1435255621); background-repeat:no-repeat; background-size: auto; } .black_bg { background-color: black; padding: 3px; } </style> <Font color = White> <CENTER> <H2><span class = "black_bg"><strong>A GENERAL CALCULATOR</span> </H2> <HR> <?php $n1 = $_POST['num1']; $n2 = $_POST['num2']; $_SESSION['v1'] = $n1; $_SESSION['v2'] = $n2; print "Num1 is: $n1<p>"; print "Num2 is: $n2<p>"; ?> </center> <HR> <FORM action=calculator.php method=post> Choose operation: <BR> + <INPUT type=radio name=op value=add checked> <BR> - <INPUT type=radio name=op value=sub> <BR> * <INPUT type=radio name=op value=mul> <BR> / <INPUT type=radio name=op value=div> <BR> % <INPUT type=radio name=op value=mod> <BR> ^ <INPUT type=radio name=op value=pow> <BR> <P> <INPUT type=submit value=Submit> <INPUT type=reset value=Reset> </FONT> </html> <?php } ?>