Need to edge out the competition for your dream job? Train for certifications today.
Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.
Wait, so 'name' is a must?
<?php // demo/form_thankyou_page.php
// SHOW HOW TO DO FORM INPUT, VALIDATION, AND THANK YOU PAGE
// IF THERE IS SOMETHING THAT HAS BEEN POSTED
// THIS IS THE VALIDATION PROCESS - ONLY TWO RESULTS
// EITHER A FAILURE PAGE OR A THANK YOU PAGE
// CHECK TO SEE IF IT IS WHAT WE EXPECT
if ($_POST["xyz"] != 'XYZ')
// CREATE ERROR PAGE IF DATA FAILED VALIDATION
echo PHP_EOL . "SORRY YOU DID NOT ENTER XYZ";
// CREATE THANK YOU PAGE IF DATA PASSED VALIDATION
echo PHP_EOL . "THANK YOU, ";
die("ALL DONE NOW");
// END OF PHP - DROP INTO HTML TO PUT UP THE FORM
ENTER 'XYZ' IN UPPER CASE LETTERS HERE:
<input name="xyz" />
<input type="submit" />
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.