हिंदी

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

Advertisements
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 [पृष्ठ ७८]

APPEARS IN

बालभारती Information Technology (Science) [English] Standard 12 Maharashtra State Board
अध्याय 5 Server-Side Scripting (PHP)
Exercises | Q 7.1 | पृष्ठ ७८
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×