How to send data back by PHP

When you go into a registering site, the password requires one number and you just put in letters. The website is diverted to the same website with all your data except your password. I would like to do that in PHP.

By the “POST” method I bring the data into the PHP website. I just do not know how to send the data back with the header pointing back to the same website it originated from. How do you send data from the PHP or Server back to the newly formed website?

Essentially, you could do it like this:


<?php
// pseudo code
if( validation is good ){
// save the data
// redirect to the next page
// exit();

}

// otherwise fall through to here and just show the form again
?>

<form action="" method="POST">
<input type=text name="firstName" value="<?php if( isset($_POST['firstName']) ) echo htmlentities($_POST['firstName']) ?>" />
<input type="submit">
</form>