How to pass value of one page's textbox to another page's textbox?

Hi Friends,

I have one requirement where I have one textbox & submit button, when I click that button by filling value on that textbox I need it will redirect to different page & the value of that textbox automatically come into this page textbox. If any one have any idea kindly help me.


Trivially you could accomplish this using the GET method for your form, and do a redirect using

// your script must output nothing up to this stage
header("Location: /newurl.php?tbox=" . $_GET['tbox]);

That has limitations about the size of the amount of text you can use, and some would consider it as ugly.

Then you could just make the new script the target of your form, using the POST method to that new script then show the text that had been entered


<form method=POST action=newurl.php>


<textarea><?php echo $_POST['tbox']; ?></textarea>

You could use a session variable to remember the text box data and then repopulate the form in the next page.

** You’d need to add some html escaping on these examples in order to protect users.