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.

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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.