I'm currently working on adding a contact form to one of my clients sites but i'm having an issue. I put the contact form in the sidebar so that i could use it across the whole site instead of just one page, but i'm not sure how to get it to send the mail if it's in the sidebar.
The main problem is the <form action="">, i have no idea where to point it. I've tried pointing it to the same file as the contact form (like you would on a static site) but then when you submit, it takes you to the sidebar.php page so it can mail.
I've also tried putting the mailing part of the code in the header and leaving the HTML for the form in the sidebar.php, but then i'm still not sure where to point the action. I tried using index.php and also just having it as the root address but those took me to 404 pages instead of keeping me on the current page (although they did send, so it was getting to the mail code in the header.php)
I'm just not sure how to accomplish this, at this point i'm ready to just iframe the contact form onto the page so i can keep all the contact code in one file and not have to worry about it going to another page. I also thought about just pointing the action to the script on the server (which would normally just take you to the file) and redirecting back to the homepage at the end, but i would like to avoid this too.
Here is the address for anyone that would like to try and help http://getsocialeyes.com/microsites/mountainviewhospital/
Also, the address to just the contact form that works (all the code in one page) (not styled as well on here though)
Maybe this is something simple, i know i could do it with ajax or an iframe, but i would like to have it work like a normal contact form where you submit from the content area, it goes to the header, processes, sends, then the page refreshes.
So if there's any way to either leave all the code in sidebar.php or separate the code out into different areas (sidebar, header, etc) and have it work i would love to know.
Thanks in advanced!