Currently I am working on php project. I tried to bring textbox value, which is
$password = $_POST['password']
from Forgotpassword.php to Thank-You.php file.
A lot of people advised me to put include('Forgotpassword.php') on Thank-You.php but when I put include('Forgotpassword.php') on Thank-You.php, whole form from forgotpassword.php was showed on Thank-You.php. I just want to retrieve only textbox value on Forgotpassword.php.
Any idea?
You can done it by using session, in your Forgotpassword.php
<?php
session_start();
$data=$_POST['key'];
$_SESSION["variable"] = $data;
?>
And in your thankyou.php
<?php
session_start();
$data=$_SESSION["variable"];
echo $data;
?>
Forgotpassword.php:
<form method="post" action="Thank-You.php">
<input type="password" name="password" />
<input type="submit" value="Submit" />
</form>
Thank-You.php:
<?php $password = $_POST['password'];