Everything is working great as fasr as form validation and the email and database functions but I have to things I am trying to accomplish and having little to no experiance in php I was hoping I could get some help here.
PROBLEM #1:
I am using custom error and thank you pages by using the following style redirect
What I am trying to accomplish is passing the data into thees custom pages for examples the error page I would like it to display the error messages from the process.php file. On the thank you page I would like it to show the information they submitted.
If someone could show me how to pass the data I would appreciate it.
PROBLEM #2:
I want to trim the information being submitted on the form so that the database doesn't have extra whitespace but more importantly I do not get validation errors when there is trailing whitespace on the email address.
I have tried using $Email=trim($Email); in the process.php file however I still get an error if there is any extra spaces after the email address.
Any help on this would be appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
#1, take a look at the process.php for a form that generates it's own thankyou page. The HTML is at the bottom of the page and it includes short <?php ?> sections to display the form data. I suggest you follw the same method and just paste your thankyou page html code into the end of the process.php file. You can then modify this html by inserting the appropriate php code sections to display the data.
Everything is working great as fasr as form validation and the email and database functions but I have to things I am trying to accomplish and having little to no experiance in php I was hoping I could get some help here.
PROBLEM #1:
I am using custom error and thank you pages by using the following style redirect
header("Refresh: 0;url=http://www.mywebsite.com/errorpage.htm");
header("Refresh: 0;url=http://www.mywebsite.com/thankyou.htm");
What I am trying to accomplish is passing the data into thees custom pages for examples the error page I would like it to display the error messages from the process.php file. On the thank you page I would like it to show the information they submitted.
If someone could show me how to pass the data I would appreciate it.
PROBLEM #2:
I want to trim the information being submitted on the form so that the database doesn't have extra whitespace but more importantly I do not get validation errors when there is trailing whitespace on the email address.
I have tried using $Email=trim($Email); in the process.php file however I still get an error if there is any extra spaces after the email address.
Any help on this would be appreciated.
#1, take a look at the process.php for a form that generates it's own thankyou page. The HTML is at the bottom of the page and it includes short <?php ?> sections to display the form data. I suggest you follw the same method and just paste your thankyou page html code into the end of the process.php file. You can then modify this html by inserting the appropriate php code sections to display the data.
#2, the trim function trims from either side of a variable.
http://www.w3schools.com/php/func_string_trim.asp