There is a contact form which current action is http://www.siteA.com/ContactInfo.php
, it sends fields and values.
In ContactInfo.php, i just catch the values and se
You can try something like this using cURL (http://www.php.net/manual/en/curl.examples.php) ..
$sub_req_url = "http://www.siteB.com/Reg.aspx";
$ch = curl_init($sub_req_url);
$encoded = '';
// include GET as well as POST variables; your needs may vary.
foreach($_GET as $name => $value) {
$encoded .= urlencode($name).'='.urlencode($value).'&';
}
foreach($_POST as $name => $value) {
$encoded .= urlencode($name).'='.urlencode($value).'&';
}
// chop off last ampersand
$encoded = substr($encoded, 0, strlen($encoded)-1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_exec($ch);
curl_close($ch);
Shamly
I'd encourage you to try the Snoopy Class. It's really rather simple:
<?php
$vars = array("fname"=>"Jonathan","lname"=>"Sampson");
$snoopy = new Snoopy();
$snoopy->httpmethod = "POST";
$snoopy->submit("http://www.siteB.com/Reg.aspx", $vars);
# Use the following if you need to view the results
# print $snoopy->results;
?>
Without seeing your code it's hard to say what the problem is.
Questions:
Is site B a domain you also own, or is it third party? If it's third party they may be running bot checks and the like that would make your POST fail.
Have you done anything to confirm that the data is in fact being send to domain B?
If domain B is also under your control, my guess is they are running on the same web server - why not just write logic into the domain A page that does whatever it is that needs to be done without having to submit to domain B?