Hello,
I had a script that I wanted to run, which basically sends data to another website.But as soon as I click submit, it is directly running rs forms function before executing the script.Here is the script. Can anybody tell me what the problem might be?
function CallURL($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
$out = curl_exec($ch);
curl_close($ch);
return $out;
}
if ($_POST['form']['Submit']=='Submit' )
{
$url = "
demo.website.com/joomla_create_company_l...amp;user_name="$_POST['form']['Company_Name'];
$result = CallURL($url);
if ($result == 'Error' ) die();
else if ($result == 'Ok' )
{
$comp = "
demo.website.com/joomla_create_company_l...?company_name="$_POST['form']['Company_Name']."&user_name="$_POST['form']['Company_Email']."&company_admin_email="$_POST['form']['Company_Email']."&password="$_POST['form']['C_Password'];
$companyID = CallURL($comp);
print $companyID;
}
}