PHP POST method



Αξιολόγηση Χρήστη:  / 0
ΧειρότεροΚαλύτερο 
Λεπτομέρειες

The POST method transfers information via HTTP headers. The information is encoded as described in case of GET method and put into a header called QUERY_STRING.

  • The POST method does not have any restriction on data size to be sent.
  • The POST method can be used to send ASCII as well as binary data.
  • The data sent by POST method goes through HTTP header so security depends on HTTP protocol. By using Secure HTTP you can make sure that your information is secure.
  • The PHP provides $_POST associative array to access all the sent information using GET method.

example :

file post.html

View source
<html>
<body>
 www.developerpages.gr <br><br>
 <form action="post.php" method="POST">
 First Name: <input type="text" name="firstname" /> <br>
 Last Name: <input type="text" name="lastname" /> <br>
 <input type="submit" />
 </form>
</body>
</html>

file post.php

View source
<?php
 
 
if( $_POST["firstname"] || $_POST["lastname"] )
 {
 echo "Welcome ". $_POST['firstname']. " ". $_POST['lastname']. "<br />";
 exit();
 }
?>


You have no rights to post comments

   
   

     

© Developerpages