I am working on a website and I have a form that asks for a few inputs from users and I would like to save the fields to my local SQL database and still POST them to an external website. This is how i have the form tag set up right now: <form name="example_form" method="POST" action="http://www.example.com/dir/result.php"> I would like it to Save the fields to my SQL database before it POSTs them to the above website. Please help me if you can!!! Thank you.
use onsubmit event in <form> by using you post all data to specific url using ajax/iframe and then normally post form data
As far as I know you can't normally access other domain using AJAX, so you submit your form to your script (on the same domain as form located) with AJAX and place other script in action of this form.
I would like to accomplish this with out AJAX if possible because I don't want it to only work if someone has javascript enabled. I am new to PHP and am unfamiliar with cURL. If I use this method will it still transfer the user to the external page? Thank you for your input.
No CURL not transfer user to another page, but you can transer user to externel page using header function, after you write data to DB - header("Location:http://www.your-another-page.com")
if i use the header function will i still be able to POST the form's fields to the external website with the same results as if i just POSTed it right to the website without it knowing any differant?
Could save the files to the database and then use a seperate page to load the database information to an RSS feed. The other website sources upon this RSS feed. Wouldn't even really have to be an RSS feed, could just write the data to the page then use "file_get_contents()" to read on your external site. If the external site is located on the same hosting page it could also share the database.
I dont have access to the external website... I can't change the way they receive the information at all or it wont work. I have never done anything with rss feeds and am not sure how to do that. I know this is sounding increasingly harder... I wish there was just a way to POST a form to 2 places at the same time.