Data Sending Ways in PHP

There are some certain ways to send your information or data to the PHP page-

  1. Using Form Methods – Get & Post
  2. Using Cookies & Session
  3. Using Query String / URL Rewriting
  4. Using Hidden form field

Form Methods             

The GET Method: The GET method sends information separated by the ? Operator.

Example: http://www.xyz.com/home.html?city=Gurgaon

Please note that the GET method is restricted to send upto 1024 characters (1024 bytes) only. You should not use GET method if you have password or other confidential information to be proceeding over the server.

GET can’t be used to send binary data, like images or word documents, to the server.

The PHP provides $_GET associative array or super global variable to access the data sent using GET method.

Example –GET Method:

Let’s create a HTML form that contain several form elements

HTML Page: form.html

<form action =”thanks.php” method=”GET”>

Enter Name : <input type=”text” name=”txtName”>

<input type=”submit” value=”Submit”>

</form>

Here we have a text field called txtName, basically we wanted to send the value of this field to the PHP page called thanks.php. Make sure your form should contain a button type submit to send information to action page.

Let’s create a page thanks.php in the same directory where we have the above html page

PHP Page: thanks.php

<?php

echo $_GET[‘txtName’];

?>

Meanwhile you can see the same entered value on the browser‘s address bar. Here we have print the same value received through text field named txtName. Make sure the same name to be put inside [ ] of super global variable $_GET as mentioned in HTML Form.

The POST Method

The POST method transfers information via HTTP headers.

The POST method does not have any restriction on data size to be sent. So it can be used to send files, images as well as binary data as well.

The PHP provides $_POST super global variable or associative array to access data sent using POST method.

Example –POST Method:

Let’s create a HTML form that contain several form elements

HTML Page: form.html

<form action =”thanks.php” method=”POST”>

Enter Email : <input type=”email” name=”email”>

Enter Password : <input type=”password” name=”pass”>

<input type=”submit” value=”Login”>

</form>

Here we have two fields email field called email, password field called pass, basically we wanted to send these above values to the PHP page called thanks.php

Let’s create a page thanks.php in the same directory where we have the above html page

PHP Page: thanks.php

<?php

echo $_POST[‘email];

echo $_POST[‘pass];

?>

Here we have print the same value received through email and password field respectively.

We can make it little advanced by taking above posted values to the variables. The advantage of using variable will be like we can use some validation and sanitizing data before preceding it to the database.

So the above code can be modified something like-

<?php

// collect values in the variables separately

$email= $_POST[‘email];

$password= $_POST[‘pass];

// you may use some validations like

if($email==”” || $password==””)

echo “Input required”;

else

echo “Welcome “.$email . “ Your password is “.$password;

?>

19 thoughts on “Data Sending Ways in PHP

  1. Revolutional update of SEO/SMM software “XRumer 16.0 + XEvil”:
    captcha solving of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another size-types of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? You can find a lot of impessive videos about XEvil in YouTube.
    You read it – then IT WORKS!
    Good luck!

    XRumer201708

  2. Revolutional update of SEO/SMM package “XRumer 16.0 + XEvil”:
    captchas regignizing of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another size-types of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

    Interested? There are a lot of impessive videos about XEvil in YouTube.
    You read it – then IT WORKS!
    Good luck 😉

    XRumer201708

  3. Revolutional update of SEO/SMM package “XRumer 16.0 + XEvil”:
    captchas solving of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another types of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

    Interested? There are a lot of demo videos about XEvil in YouTube.
    You read it – then IT WORKS!
    Good luck!

    XRumer201708

  4. Revolutional update of SEO/SMM software “XRumer 16.0 + XEvil”:
    captchas solving of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another types of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? You can find a lot of introducing videos about XEvil in YouTube.
    You read it – then IT WORKS!
    See you later!

    XRumer201708

  5. Revolutional update of SEO/SMM package “XRumer 16.0 + XEvil”:
    captchas regignizing of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another categories of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? You can find a lot of introducing videos about XEvil in YouTube.
    You read it – then IT WORKS!
    See you later!

    XRumer201708

  6. Absolutely NEW update of SEO/SMM package “XRumer 16.0 + XEvil 3.0”:
    captcha solving of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another size-types of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? You can find a lot of demo videos about XEvil in YouTube.
    You read it – then IT WORKS!
    Good luck!

    XRumer201708

  7. Revolutional update of SEO/SMM package “XRumer 16.0 + XEvil”:
    captcha recognition of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another subtypes of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? You can find a lot of introducing videos about XEvil in YouTube.
    You read it – then IT WORKS!
    See you later!

    XRumer201708

  8. Revolutional update of SEO/SMM package “XRumer 16.0 + XEvil 3.0”:
    captchas solution of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another categories of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

    Interested? You can find a lot of impessive videos about XEvil in YouTube.
    You read it – then IT WORKS!
    See you later!

    XRumer201708

  9. Absolutely NEW update of SEO/SMM software “XRumer 16.0 + XEvil 3.0”:
    captcha solution of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another size-types of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? There are a lot of impessive videos about XEvil in YouTube.
    You read it – then IT WORKS!
    Good luck!

    XRumer201708

  10. Revolutional update of SEO/SMM package “XRumer 16.0 + XEvil”:
    captchas recognition of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another types of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? You can find a lot of demo videos about XEvil in YouTube.
    You read it – then IT WORKS!
    See you later 😉

    XRumer201708

  11. Revolutional update of SEO/SMM package “XRumer 16.0 + XEvil 3.0”:
    captcha solving of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another subtypes of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? There are a lot of demo videos about XEvil in YouTube.
    You read it – then IT WORKS!
    Good luck 😉

    XRumer201708

  12. Revolutional update of SEO/SMM package “XRumer 16.0 + XEvil”:
    captcha solution of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another size-types of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

    Interested? There are a lot of introducing videos about XEvil in YouTube.
    You read it – then IT WORKS!
    See you later 😉

    XRumer201708

  13. Absolutely NEW update of SEO/SMM software “XRumer 16.0 + XEvil”:
    captchas recognition of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another categories of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? There are a lot of impessive videos about XEvil in YouTube.
    You read it – then IT WORKS!
    See you later 😉

    XRumer201708c

  14. Revolutional update of SEO/SMM software “XRumer 16.0 + XEvil 3.0”:
    captcha regignizing of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another types of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? There are a lot of demo videos about XEvil in YouTube.
    You read it – then IT WORKS!
    See you later 😉

    XRumer201708c

  15. Absolutely NEW update of SEO/SMM software “XRumer 16.0 + XEvil”:
    captchas solution of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another subtypes of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

    Interested? You can find a lot of impessive videos about XEvil in YouTube.
    You read it – then IT WORKS!
    Good luck 😉

    XRumer201708c

  16. The fashion business is varying very speedily every year that is the reason some of this modern dresses, bags and purse which have been known last years were now regarding your fashion. But this is not the case with coach purse and bags. Coach was never out of fashion this is the reason why numerous women around the globe choose to coach merchandises even whether it is a little merely pricey compare to be able to brands. Coach is having their products to be constantly in style. This is the greatest trip that perfect have during weekends. Pause to look for see a fantastic of different styles of purses, purse and accessories any user surely get rid of all your mind. http://www.tiendaskon.com.es Owning one of the leading brands across the country such as Coach is one of the greatest achievements for each and every woman in life. Coach gives you wide selections inside their products with regard to Handbags, Accessories and Totes. Coach purse can give you fashionable and sturdy purse that you can use anytime and anywhere. Discover only find authentic and high quality coach purse inside coach method. Visit any Coach Purse Outlet near to you. You can also have all things that you prefer without the requirement to travel and tire yourself with the expertise of online online shopping. Find your choice of of authentic mulberry handbags can make your mouth spin. Are usually many many Mulberry Collection handbags on Vivabag at prices discounted lower than retail. Many discount Mulberry bags basically just waiting which to discover their whereabouts. The “On Sale” section offers inventory at a Spring/Summer 2009 mulberry handbags at special prices. Another section introduces the Fall/Winter handbag collection and entices you to search ahead. You can discover as many fashion mulberry handbags as factors and find no distinction or unique attributes of the signature handbag compared additional leading signature bags on the market today. Mulberry handbags maker simply understand that you have many uses and moods of women so they made different pores and skin bags that answers every need. In effect, women can find all their handbag needs with Mulberry handbags in the highest quality and from a well-known signature brand. In case you’re in for stylish handbags, Mulberry handbags offer the Euston, Agyness, or Joddy shopper wholesale handbags. They are made with accessories and stylish compartments. Those who are for an existing travel bag, there’s the Mulberry Tripper. For more hip bag, you can choose Mulberry Aston. .

  17. hair gradually look, lesean mccoy jersey, philadelphia eaglesKickers are generally drafted in the final 2 rounds of Fantasy Football Drafts. Because most Fantasy Soccer leagues have twelve owners, your goal is to pick 1 of the top 12 scoring kickers in the league. There are 32 NFL teams, so you have a better than even opportunity to get a leading twelve kicker, even in a blind draw. The difference between the best kicker and the 12th ranked kicker is only about 2 factors per game. Everyone knows Gostkowski et al, but who are the accurate sleepers out there? Study on and pick up some extra points about sleeper kickers. http://www.cashstore-pass.fr free fantasy football, fantasy football, larry fitzgerald, nfl kickoffWhen the St. Louis Rams take the field for their 2013 NFL season opener late Sunday afternoon at the Edward Jones Dome, they are likely to find out that their longtime NFC West rival, the Arizona Cardinals, look a lot different than they did last season. Utley adopted with a two-operate solitary to reduce it to four-2. The stoic Utley slapped his hands together at initial foundation in an uncharacteristic display of emotion while the sellout crowd roared. Arroyo fanned Howard to finish the inning. Now they’ve come full circle. Moore was at the oufielder’s aspect as Francoeur formally joined the Kansas City Royals on Monday, where to purchase Discount cheap mlb jersey? maybe ujersy is a great option. .

Leave a Reply

Your email address will not be published.

Enjoy the tutorial? Please spread the word :)

Follow by Email
Facebook
Facebook
Google+2k
Google+
http://hirdeshbhardwaj.com/2017/05/06/data-sending-ways-php/
YouTube31
YouTube