Jump to content

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!

Can you just make a small example, I'm not sure if I got it right.

 

So basiclly:

<form action="somescript.php">
all the code here
<submit button here>
</from>

 

And i put include for second script into somescript.php????

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.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.