I like to know how to send the form details to an external url as well as to email id. I had an experience in programming to the form details to email id, but one of my client is asking to redirect the copy of form details to the url as like this http://someipaddress/XDKRT/SalLeadEntWeb.ASP
, my website is developed by wordpress, can anyone guide me how to achieve this?
in script which send email you can create request with curl to this url with specific parameters from form
To send details to email.
On click of button you can call one ajax function to send details to email id. and submit the form using form.submit() through javascript
To send to external URL.
Just set the action of the form as external URL
in wordpress make a form in core and set a action of this url and take method as get or post(if data is secure) but first make sure the action url is getting the same varriables names as the action url recieving varriables using the particular getting form techniques
cURL is definitely the best way to do this. In addition to your mail function, in your PHP, add the following
define('POSTURL','http://someipaddress/XDKRT/SalLeadEntWeb.ASP');
$ch = curl_init(POSTURL);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$_POST);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //return only data
$recvd= curl_exec($ch); //$recvd now contains the returned htmldata from that page.