user1531401
user1531401

Reputation: 79

PHP Send HTML Form Data to MySQL + An External URL

My objective is to send the data that is submitted in a html form to both a mysql database (already accomplished) and also to an external URL. The reason for sending to the url as well is to add the data to a automated dialler system for our call center.

The problem I have is I can't get my head around once the information is sent to the database, how to then send to a url, I currently have my PHP page send data to mysql and THEN to an email address.

An example of the url:

http://domain.com/vicidial/non_agent_api.php?source=test&user=****&pass=****&function=add_lead&phone_number=07777777777

Any help much appreciated.

Upvotes: 0

Views: 343

Answers (1)

justushamalainen
justushamalainen

Reputation: 17

You could use cURL to send HTTP request to certain url.

<?php

$ch = curl_init("http://domain.com/vicidial/non_agent_api.php?source=test&user=****&pass=****&function=add_lead&phone_number=07777777777");
curl_exec($ch);
curl_close($ch);
?>

Cant say for sure if above snippet works, because I dont have PHP devenviroment right now, but that should be the basic idea to be able to send data to another url.

More help: http://www.php.net/manual/en/book.curl.php

Upvotes: 1

Related Questions