How to retrieve the value on the previous page

Hi,

Can anyone tell me how to get the same value of the input data.

Example:

If i have insert a data but there is a validation error,so if i click back on the page the data that has been submit must not be erase…
How to do this?
i have tried to user this code.

<input type=‘submit’ value=“$_POST[‘somedata’]” name=‘Username’/>

something like this but it print out the exact value like $_POST[‘somedata’] or $user.

Thanks for the help.

instead of $_POST use $_REQUEST

$_REQUEST[‘somedata’]

request gets $_GET,$_POST,$_SERVER etc

and although not 100% certain I am pretty sure it can be done with out registering globals

Using $_POST is fine to my knowledge, and that should be working except the first time they view they’ll get an undefined index most likely. So make the value of the form:


<input type='submit' value="<?php if(isset($_POST['somedata'])) echo $_POST['somedata']; ?>" name='Username'/>

Ah.Thanks…po…