Actually send the data to the YSF server!

This commit is contained in:
james 2006-10-19 22:54:26 +00:00
parent 2019e24b89
commit aa93c170db

View File

@ -179,7 +179,36 @@ function xmlCreateRecurse($d)
mysql_query("UPDATE projects SET cwsfdivisionid='$d' WHERE id='$p'");
}
echo happy(i18n("CWSF Project Divisions saved"));
}
if($_POST['action']=="register" && $_POST['xml'])
{
if(function_exists('curl_init'))
{
$ch = curl_init(); /// initialize a cURL session
curl_setopt ($ch, CURLOPT_URL,"https://secure.ysf-fsj.ca/registration/xmlregister.php");
curl_setopt ($ch, CURLOPT_HEADER, 0); /// Header control
curl_setopt ($ch, CURLOPT_POST, 1); /// tell it to make a POST, not a GET
curl_setopt ($ch, CURLOPT_POSTFIELDS, "xml=".$_POST['xml']); /// put the query string here starting with "?"
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); /// This allows the output to be set into a variable $datastream
curl_setopt ($ch, CURLOPT_POSTFIELDSIZE, 0);
curl_setopt ($ch, CURLOPT_TIMEOUT, 360);
curl_setopt ($ch, CURLOPT_SSLVERSION, 3);
$datastream = curl_exec ($ch); /// execute the curl session and return the output to a variable $datastream
$datastream = str_replace(" standalone=\"yes\"","",$datastream);
// echo "curl close <br />";
curl_close ($ch); /// close the curl session
echo i18n("The YSF Registration Server said:")."<br />";
echo notice($datastream);
}
else
{
echo error("CURL Support Missing");
echo i18n("Your PHP installation does not support CURL. You will need to login to the YSF system as the regional coodinator and upload the XML data manually");
}
send_footer();
exit;
}
$ok=true;