Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_REQUEST['email'])) {
- $url = "http://cliente.hostzone.com.br/includes/api.php"; # URL to WHMCS API file
- $username = ""; # Admin username goes here
- $password = ""; # Admin password goes here
- $postfields["username"] = $username;
- $postfields["password"] = md5($password);
- $postfields["action"] = "OpenTicket"; #action performed by the [[API:Functions]]
- $postfields["deptid"] = "4";
- $postfields["email"] = $_REQUEST['email'];
- $postfields["name"] = $_REQUEST['nome'];
- $postfields["subject"] = "Contato no Site Hostzone";
- $postfields["message"] = $_REQUEST['comment'];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 100);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
- $data = curl_exec($ch);
- curl_close($ch);
- $data = explode(";",$data);
- foreach ($data AS $temp) {
- $temp = explode("=",$temp);
- $results[$temp[0]] = $temp[1];
- }
- if ($results["result"]=="success") {
- echo "<script>alert('Mensagem enviada com sucesso!');</script>";
- } else {
- # An error occured
- echo "Ocorreu um erro: ".$results["message"];
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement