Write two different PHP script to demonstrate passing variables through a URL and Write two different PHP script to demonstrate passing variables through Hidden Variables || DWPD Sem 5 Practical 17

Best Smartphone Under 20000/-

Shop Now

DWPD : Practical 17-A

Write two different PHP script to demonstrate passing variables through a URL


Script for index.php file<?php
 $fname="Sarjil";
 $lname="Shaikh";
?>
<a href="retrive.php?First_name=<?php echo $fname; ?>&last_name=<?php echo $lname; ?>">
Click here to Pass Variable through URL
</a>

Output : 

 

 

Script for retrive.php file<?php
 echo "First Name : ".$_GET['First_name']."<br>";
 echo "Last Name : ".$_GET['last_name'];
?>

 Output : 





DWPD : Practical 17-B
Write two different PHP script to demonstrate passing variables through Hidden Variables

Script for index.php file<html>
<head>
<title>Hidden Variables</title>
</head>
<body>
 <form method="post" action="retrivehidden.php">
  <input type="hidden" name="fname" value="Sarjil">
  <input type="hidden" name="lname" value="Sarjil">
  <input type="submit" name="submit" value="submit">
 </form>
</body>
</html>

Output :

 


Script for retrivehidden.php file<?php
 if(isset($_POST['submit']))
 {
  $fn=$_POST['fname'];
  $ln=$_POST['lname'];

  echo "First name = $fn <br>";
  echo "last name = $ln";
 }
?>

 Output :

 

Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. BHaiya bacha liya apne late submission se

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete
  5. Most welcome bro
    Share this with your friends 😊
    If you have any questions please feel free to ask me at : hardhebro@gmail.com
    I will post it's solution in my next blog 💯🔥

    ReplyDelete
  6. Replies
    1. you welcome bro :p share with your classmates

      Delete
    2. you welcome bro :p share with your classmates

      Delete
  7. Last year submission kal he or aaj apki website se mene sare baki ke practical khatam kiye, thank you bro 🤩

    ReplyDelete

Post a Comment