Is it possible to have a single form submit to two PHP scripts?

by on September 30, 2009

Q: Is it possible to have an HTML form that passes the same value to two different PHP files and then display the two in one window?

I am using PHPLot and once I create the graph I want to display the list, in HTML format, of information that is being graphed.

One Response to “Is it possible to have a single form submit to two PHP scripts?”

    There are a number of ways you can handle this.

    1. You could use AJAX to submit to two PHP scripts and have the data output on the page. I am not sure exactly how you are submitting data or what data you are submitting data so this either makes a lot of sense to do or no sense at all.

    2. You could use frames and have the form submit to a framed page that would then call the script. This by far is the worst solution but none the less a solution.

    3. I think the best solution is that you submit the data to a single PHP script. The script would then call the other two scripts and it would control how the page looks. So you could easily make a table or use some divs to enclose the data from each of the other scripts.