Skip to content

Instantly share code, notes, and snippets.

@ambiorixg12
Created November 23, 2023 03:49
Show Gist options
  • Save ambiorixg12/c787f5828a1d1f753f412635475b982d to your computer and use it in GitHub Desktop.
Save ambiorixg12/c787f5828a1d1f753f412635475b982d to your computer and use it in GitHub Desktop.
<?php
// Initialize a cURL session
$ch = curl_init();
// Create a query string from the array of parameters
$params = array(
"username" => "sms",
"password" => "1982",
"phonenumber" => "18097143489",
"message" => "122",
"port" => "gsm-1.4"
);
$query = http_build_query($params);
// Set the URL with the query string and other options
curl_setopt($ch, CURLOPT_URL, "http://10.0.0.5/sendsms?" . $query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute the request and get the response
$response = curl_exec($ch);
// Close the cURL session
curl_close($ch);
// Print the response
echo $response;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment