I have a number of sites with the same contact page, and I made a PHP form for each site that sends me an email when someone fills out the contact form. The php form then redirects the person to a ‘goodbye’ page.
For example, here are two of my contact forms:
Each of the above pages has a PHP form that automatically sends me an email. The PHP form then re-directs the person to a goodbye page:
I have many other sites with the same setup. Below is a copy of my standard PHP form. The question is this: instead of making a new PHP form every time I start a new site, I’d like to keep just one PHP form for all my sites. Here is the problem: As you see below, I usually just redirect to ‘contact-thankyou.htm’, which works fine because the PHP form is sitting within the domain. However, if I setup a PHP form on MYSITE.com and have the rentlakegeorge.com and schroonlakerentals.com contact forms use that PHP form, how do I re-direct them back from MYSITE.com to the rental site??? I think the ‘$Website’ value should be used in the $redirect_to formula but I can’t figure out how to do it.
Thanks in advance for any advice.
MY PHP FORM AS IT IS:
– MOD EDIT - ADDED PHP TAGS FOR EASIER READING