Hi Ray, I have added the validation code to the thanks page, but I am now getting errors in the process of what I am trying to achieve.
WITH THIS THE FORM VALIDATES BUT RECORD INSERT NOT WORKING WITH THIS LINE OF CODE
<form action="bike-enquiry-thanks.php?id=<?php echo($rs_bike->getColumnVal("fld_bid")); ?>" method="post" id="enquiry" name="enquiry">-->
WITH THIS THE FORM WON'T VALIDATE BUT RECORD WILL INSERT WITH THIS LINE OF CODE
<form action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>" method="post" id="enquiry" name="enquiry">
I was hoping to add all the code to one page (bike-enquiry.php) so it would be easier to troubleshoot rather than have to do it across several pages. I am still to add in code for sending emails yet. By having code on two separate pages seems to kill off one or the other processes.
I assume I need to do it in this order:
1. Validate form entries
2. Enter form contents onto DB
3. Trigger email of form contents
However, by having the validation on a subsequent page seems to be breaking that process, so how do I ensure that all processes are on one page in a sequential order?
Why is my validation on the page with the form not working? Why do I need to move it to the thanks page as this seems to be the crux of the problem? And if I need to move validation to the subsequent page, how do I then do the insert and send email?
Thanks.