Jump to content

[SOLVED] Submit button calling two php scripts???


budimir

Recommended Posts

Guys, is it possible to use one form which would send the data to diferent files and return the results??

 

For example, I have one page on which I enter my criteria and when I hit submit it would need to send this data to different php scripts from which one would display the data and second one would display the chart!

no,

you have the html page with the form on it.  Point to actions to another php script.  We'll call it dataViewer.php

 

Now, if your two other pages are designed to process form data pulled directly from POST or GET, dataViewer.php would just look like:

 

<?php

## display the data
include('data_display.php');

### display chart
include('chart_display.php');

?>

 

otherwise, you will have to put the code in that formats the form data to the form needed by the scripts before the includes.

 

in this case cURL would be sort of a waste.

 

when you include a file, you basically take everything that is in it and dump in place of the include.  So that script, as it is written will execute (in order) data_display.php then chart_display.php  as if you had copied the code out of both files and pasted it into one.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.