PHP question. I have the HTML for this but im stuck on the php part. Thanks for
ID: 3760648 • Letter: P
Question
PHP question. I have the HTML for this but im stuck on the php part. Thanks for your time
create an application that takes the radius submitted from this form and displays:
Circumference of a Circle
Area of a Circle
here is the html
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Question 1</title>
<style type="text/css">
<!--
#wrapper {
padding: 25px;
width: 700px;
margin-top: 10px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
font-family: Arial, Helvetica, sans-serif;
border: 2px solid #000;
background-color: #FFF;
}
body {
background-image: url(images/q1bg.png);
}
-->
</style>
</head>
<body>
<div id="wrapper">
<h1>Question #1</h1>
<p>Enter a nudmer in the fourm to get the:</p>
<ul>
<li>Circumference of a Circle</li>
<li>Area of a Circle</li>
</ul>
<p>Look at this form for information. Feel free to modify this form if you believe you need to.</p>
<form id="frm_q1" name="frm_q1" method="get" action="question1.php">
Enter the radius of a circle:
<input name="radius" type="text" id="radius" size="12" maxlength="12" />
<br />
<br />
<input type="submit" name="button" id="button" value="Submit" />
</form>
<p> </p>
</div>
</body>
</html>
Explanation / Answer
question1.php
$radius = $_GET['radius'];
echo "Circumference of circle is " + 2*3.14*radius;
echo "Radius of circle is " + 3.14*radius*radius;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.