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 fieldForm MethodsThe 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.

    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.

    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;

    ?>

About Us

Luckily friends do ashamed to do suppose. Tried meant mr smile so. Exquisite behaviour as to middleton perfectly. Chicken no wishing waiting am. Say concerns dwelling graceful.

Services

Most Recent Posts

  • All Post
  • advanced-excel-training
  • Branding
  • deepti saini model
  • Development
  • Digital Marketing
  • digital marketing course gurgaon
  • Digital Marketing Internship Gurugram
  • digital marketing jobs
  • digital-marketing-institutes-sector-14
  • Leadership
  • Management
  • Notice
  • php-development-courses
  • php-full-stack-development-courses
  • php-job-opportunity
  • php-training
  • php-training-in-baksar
  • php-training-in-balia
  • php-training-in-bangalore
  • php-training-in-delhi
  • php-training-in-faridabad
  • php-training-in-gaziabad
  • php-training-in-gorakhpur
  • php-training-in-gurgaon
  • php-training-in-kolkata
  • php-training-in-muzaffarpur
  • php-training-in-noida
  • php-training-in-patna
  • placements
  • web development training gurgaon

Company Info

She wholly fat who window extent either formal. Removing welcomed.

Limited Seats Available – Register Now

We keep batch sizes limited so every learner gets personal attention and proper doubt solving. Reserve your seat now and start your training in the next batch without delay. For details call us +91- 8802000175

Help

Privacy Policy

Terms

Conditions

Subscribe Now

For latest news and updates, fill your details below-

You have been successfully Subscribed! Ops! Something went wrong, please try again.
© 2023 Created with Royal Elementor Addons