I am needing help with a form. Senario...
I have a form that asks for a firstname, lastname, phone, and problem description. When they click on "submit", it sends them to a confirmation page, which, says thanks and also inserts the record into the mysql database. Now, what I can't get my script to do, is to also, with the thank you, display the information they just entered into the form. I can get it to output all the records, but i can't get it to output what the user has just inputed into the form. Instead, it displays all the records. Any help would be appreciated.
outputting db form data
Moderator: General Moderators
If you using POST method in your form, the form output should look something like this:
// But of course you should also use strip_tags or htmlspecialchars functions to write more secure code. See the manual for more details.
Code: Select all
echo "Firstname: ".$_POST['fistname']."<br/>";
echo "Lastname: ".$_POST['lastname']."<br/>";
echo "Phone: ".$_POST['phone']."<br/>";
echo "Problem description: ".$_POST['problem']."<br/>";// But of course you should also use strip_tags or htmlspecialchars functions to write more secure code. See the manual for more details.