मराठी

Write Programs for the following. Write a PHP code which calculates square of any number using form.

Advertisements

प्रश्न

Write Programs for the following.

Write a PHP code which calculates square of any number using form.

थोडक्यात उत्तर
Advertisements

उत्तर

Coding:

<html>
<body>
<form method="post">
Enter a Number
<input type="text" name="sq"><br><br>
<input type="submit" name="submit" value="Sqaure">
</form>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
$sq= $_POST['sq'];
$s=$sq*$sq;
echo "<br><br> The Square of number is: ".$s;
}
?>
shaalaa.com
PHP Form Connectivity with Database
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 5: Server-Side Scripting (PHP) - Exercises [पृष्ठ ७८]
Advertisements
Share
Notifications



      Forgot password?
Use app×