PHP How to get URL parameters GET POST method

In this video I have shown you how you can get URL parameters with a get request.
I have shown that doing it through a form and a href link.
This example is shown by running the PHP in xampp server in windows PC.

1. GET method to submit and receive data from one page to another is shown below.

Below page shows index.php with a href link and a simple html form.

Once the user clicks the href link or submit input values though html form. The data is submitted to get_method.php page and it is received using $_get keyword.

After running the pages in xampp server, the page is shown below.
index.php
get_method.php

2. POST method to submit and receive data from one page to another is shown below.

The post method will not work for href link. It will work for html form only.
Below code shows html form to submit values through post method.

The user submits the data to post_method.php page and it is received and printed on the post_method.php page.

index_post.php

index_post.php

202 views