Jump to content

Form submit to multiple websites


PyraX

Recommended Posts

You mean you want to submit data from one form into two different pages?

 

If you mean for verification purposes or something of the sort, maybe something like this would work:

 

if (isset($_POST['variable'])) {
include('page1.php');
include('page2.php');
}

 

And on the other pages if you ever have anything echoed make sure to specify not to echo unless that variable is triggered. So like on page1.php:

 

if (!isset($_POST['variable'])) {
} else {
process();
}

 

Where if the variable isn't set not to do anything, but if it is go to process();.

 

Hope that helped.

How complex are the forms?

 

If the answer is not, just build a url with get variables.

 

Otherwise, you want something like this:

 

// create a new curl resource

$ch = curl_init();

 

// set URL and other appropriate options

curl_setopt($ch, CURLOPT_URL, "http://projects/phpit/content/using%20curl%20php/demos/handle_form.php");

 

// Do a POST

$data = array('name' => 'Dennis', 'surname' => 'Pallett');

 

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

 

// grab URL, and print

curl_exec($ch);

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.