Send Data from One Page to Another Page in PHP

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 Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

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

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements