Monday, March 27, 2017

Easily understand Get And Post Methods in PhP




Easily understand Get And Post Methods in PhP

           Above Scripts

  1. <?php
  2. $x = 'Hello';
  3. echo $x; 
  4. ?>
  5. <a href= "index.php?id">get</a>
  6. <?php 
  7. if(isset($_GET['id']))
  8. {
  9.     echo '<br>hello i got it';
  10. }
  11. ?>
  12. <form action="index.php" method="post">
  13. <input type="submit" value='post' name="submit">
  14. </form>
  15. <?php 
  16. if(isset($_POST['submit']))
  17. {
  18.     echo '<br>hello i got it';
  19. }
  20. ?>

No comments:

Post a Comment