PyraX Posted August 16, 2007 Share Posted August 16, 2007 Hi, What i am trying to do is submit data collected in one for to forms of multiple websites. How do I do this? Thanks in advance, PyraX Quote Link to comment Share on other sites More sharing options...
Sesquipedalian Posted August 16, 2007 Share Posted August 16, 2007 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. Quote Link to comment Share on other sites More sharing options...
tibberous Posted August 16, 2007 Share Posted August 16, 2007 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); Quote Link to comment Share on other sites More sharing options...
PyraX Posted August 16, 2007 Author Share Posted August 16, 2007 Thanks tibberous if I wanted to submit a file like file.example how would I do that? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.