Send Data from One Page to Another Page in PHP

Google Advertisements

Display Date and Time in PHP Exception Handling in PHP

Transfer Data from One Page to Another Page in PHP

To transfer data from one web page to another webpage we need Html form and using action="" we transfer form data on another page.

Using $_POST['field_name'] we receive form data on another page in PHP if method is post in case of get method use $_GET['field_name'];.

index.html

Html page

<form action="display.php" method="post" id="nameform">
First Name: <input type="text" name="fname"></br>
Last Name: <input type="text" name="lname"></br>
<button type="submit" form="nameform" value="submit">Submit</button>
<button type="reset" value="Reset">Reset</button>
</form>

display.php

Receive form data on other page

<?php

$first_name = $_POST['fname'];
$last_name = $_POST['lname'];

echo $first_name;
echo $last_name;

?>

When you fill html form all data will be transfer from index.php to display.php


Display Date and Time in PHP Exception Handling in PHP

Google Advertisements

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: [email protected] or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

Download Projects

Media.net Advertisements


Buy Websites 9999595223

Buy Fresh and Payment Receive Media.net Account with Website. Contact on: [email protected] or 9999595223 Try this Keyword C++ Programs