Web Contact form data to WSDL

Hi Everyone,

I am trying to get data enter by a user on a website contact from sent to a XML Web Service. I am not sure where I’m going wrong. Please view my code below?

Thank you in advance for your help.

<?php $fname = $_POST["firstname"]; $lname = $_POST["lastname"]; $officenum = $_POST["officenumber"]; $cell = $_POST["cellnumber"]; $email = $_POST["email"]; $dropdown = $POST["contactmethod"]; $message = $_POST["subject"]; $formcontent="From: $fname \n Message: $message"; $recipient = "[email protected]"; $subject = "Contact Form"; $mailheader = "From: $email \r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("Error!"); $result = ""; try { $strXML = '<?xml version="1.0" encoding="utf-8"?> '; $objWebService = new SoapClient( "https://leads.cmscloud.co.za/service.asmx?wsdl", array( "location" => "https://leads.cmscloud.co.za/service.asmx?op=SaveLead", "trace" => true, "exceptions" => true ) ); $params = array( "xml" => $strXML ); $result = $objWebService->SaveLead( $params ); } catch ( Exception $ex ) { // Check what the error is. $result = $ex->getMessage();

}
echo $result;
echo “Thank You!”. $fname."!";

?>

How should we know that? You did not specify any goal, nor any problems.

Sponsor our Newsletter | Privacy Policy | Terms of Service