How to get text field value from one php page to another page?

hiii i just want to get value of text field from one php page to another page by clicking on that value of text field of first page which is linked to each other ,after clicking on the value of text field of first page that value should be automatically set in the text field of next page, i have use following code for that

 $haspid= $row["haspid"];
         if (strlen(trim($haspid)) == 0)
        echo "<td>&nbsp;</td>";

              echo "<td valign='bottom'><a href='window.history.back();' Name=" .  $uName  . " && haspid=" .  $haspid . ">" . $haspid . "</p></td>";
        echo "</tr>";


Page 1 Code:(where user input the data)

<form method="post" action="submit.php">
    <input type="text" name="customerName" />
    <input type="submit" />

Page 2 Code:(where you want to get the data)

    echo $_POST['customerName'];


$_POST is the php's global variable. When <form> in HTML submitted with method=post we can get the value like $_POST[input_field_name]. So, after getting the value with $_POST[input_field_name] you can use it in your desired way.

Hope it helps you.

Add the value you want to pass to the url that the visitor is clicking on ...

<a href="theotherpage.php?value=XYZ">XYZ</a>

Need Your Help

Does the javascript global namespace get cleared with each full postback?

javascript global-namespace

I keep reading about the dangers of cluttering the global namespace with global variables and functions.

Changin DB transaction control in flyway with hsql

sql transactions hsqldb flyway mvcc

In HSQL to change TRANSACTION CONTROL there can't be any active transactions.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.