أخر الاخبار

exercise php

 Q1.php


<!DOCTYPE html>
<html>
    <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<a href="Q1.php">Home</a> | <a href="login.php">Second Page</a> | <a href="new.php">New Page </a>
<br>
<p>
<h1> This is Main Page </h1>
</p>
<p>
<h3> Registration Form </h3>
</p>
<p>
* required field
</p>
<form action="login.php" method="post">
<table>
<tr><td>Name:</td><td><input type="text" name="nam" required>*</td></tr>
<tr><td>Password:</td><td><input type="pasword" name="pas"  required>*</td></tr>
<tr><td>Mobile_No.:</td><td><input type="text" name="mob" maxlength="4"  required >*only 4 digits</td></tr>
<tr><td><input type="submit" value="login"/></td></tr>
</table>
</form>
<br><br><br><br>
<p>
 Visit Again: 2022 Computer Science IT Department.com
</p>
</body>

</html>

output







login.php

<?php
if($_SERVER["REQUEST_METHOD"] == "POST"){
$name=$_POST["nam"];
$pas=$_POST["pas"];
$mob=$_POST["mob"];
echo '
<!DOCTYPE html>
<html>
<body>
<a href="Q1.php">Home</a> | <a href="login.php">Second Page</a> | <a href="new.php">New Page </a>
<br>
<p>
<h1> This is Second Page </h1>
</p>
<p>
<h3> Welcome: '.$name.', You have successfully registered.</h3>
</p>
<p>
<h3> Your Input Information : </h3>
</p>

<p>
your password is: '.$pas.'<br>
and your Mobile Number is: '.$mob.' <br>
<p>
 Visit Again: 2022 Computer Science IT Department.com
</p>
</body>
</html>
';
}
?>


output





new.php

<!DOCTYPE html>
<html>
<body>
<a href="Q1.php">Home</a> | <a href="login.php">Second Page</a> | <a href="new.php">New Page </a>
<br>
<p>
<h1> This is New Page </h1>
</p>
<p>
<h3> Some Text </h3>
</p>
<br><br><br><br>
<p>
 Visit Again: 2022 Computer Science IT Department.com
</p>
</body>
</html>


output






























تعليقات



حجم الخط
+
16
-
تباعد السطور
+
2
-