Posts

Showing posts from October, 2023

PHP: ASSIGNMENT NO.:5

PRACTICE PROGRAM: 3. Write a PHP script to check mobile number entered by the user is valid or not and display an appropriate message. ANS: HTML CODE: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Document</title> </head> <body>     <fieldset>         <form action="Q3.php" method="POST">             <label for="num"><b>Enter Mobile No.:</b></label>             <input type="number" name="num" id="num"><br>             <br>             <input type="submit" name="submit" id="submit" value="submit">             <input type="reset" name="reset" id="reset" value="re...

PHP: ASSIGNMENT NO.:1

PRACTICE PROGRAM: 1. Write a PHP script to perform arithmetic operations on two numbers (Addition, Subtraction, Multiplication Division ). ANS: HTML CODE: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Document</title> </head> <body>     <form action="Q1.PHP">         enter first number: <input type="text" name="first"><br>         <br>         enter second number: <input type="text" name="second"><br>         <br>         <button>arithmetic operation!</button>     </form> </body> </html> PHP CODE: <?php $a = $_GET["first"];// readline...

PHP: ASSIGNMENT NO.:4

 PRACTICE PROGRAM: 1. Write a PHP script to calculate the area and volume of a cylinder using a function. ANS: HTML CODE: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Document</title> </head> <body>     <h1>calculate area and volume of cylinder</h1>     <form action="<?php echo$_SERVER['PHP_SELF']?>" method="POST">         <label for="radius"><b>radius</b></label>         <input type="number" name="radius">         <br>         <label for="height"><b>height</b></label>         <input type="number" name="height">         <br>         <label...