hello friends, i have two page in php, the first page contains entry form, and second page contains insert query, i want to keep form variables In the case of an error.

Recommended Answers

All 2 Replies

After the form is posted all the form variables are available in the second page in the global array $_REQUEST[]. So when you want to keep the form variables in the first page then do this:

<input type="text" name="testfield" value="<?=$_REQUEST[testfield]?>" />

or you can keep the posted form variables in session and in the first page you can put the values in value attribute as shown above.

commented: thanks +1
commented: good answer... +2

thank you very much ...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.