Name: ".$name."Email: ".$email."Mobile Number: ".$mobile.""; /* if($_SESSION["captcha"]==$_POST["captcha"]) {*/ if(mail("training@myweb.com","Form Record Received",$msg,$headers)) //$msg1="Email Sent Successfully"; header( "Location:$location" ); header("location:formsubmit.html"); ?> http://smsad.smsapiindia.com/SendSms.aspx?username=xxx&password=xxx&to=$mobile&from=xxxx&message=Thank You for Contacting $url="http://smsad.smsapiindia.com/SendSms.aspx?username=xxx&password=xxx&to=$mobile&from=xxxx&message=Thanks"; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); $auth = curl_exec($curl); if($auth) { if(mail("training@myweb.com","Form Record Received",$msg,$headers)) header( "Location:$location" ); //Some "success.php" exit; //header("location:formsubmit.html"); } }