Question no. 1 – Create a simple HTML form and accept the user name and display the name through PHP echo statement.

// File name - index.php

<!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="welcome.php" method="post" autocomplete="on">
        Name: <input type="text" name="name" placeholder="Enter name"><br>
        <input type="submit">
    </form>  
</body>
</html>

// File name - welcome.php
<!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>
    <?php
        echo "<h1> Welcome ".$_POST["name"]."</h1>";
    ?>
</body>
</html>

Output

Input field यदि उदाहरण के लिए Rahul Enter करने पर

Question no. 1 –

Write a PHP script to demonstrate arithmetic operators, comparison operators, and logical operators.

Leave a Reply

Your email address will not be published. Required fields are marked *