I am using the script below to send a SMS message to a mobile phone.
<?php
echo "Message reads - ",$message1,"<br>";
$message = "Email to SMS alert. ";
$message4 = ". Message sent at ";
$time= date("j, n, Y, H:i:s");
$user = "xxxxxx";
$password = "xxxxxx";
$api_id = "xxxxxx";
$baseurl ="http://api.clickatell.com";
$text = urlencode($message . $message1 . $message4 . $time);
if ($smsaddress1 == 1) {$to = "07967xxxxxx";}
else if ($smsaddress1 == 2) {$to = "07970xxxxxx";}
else if ($smsaddress1 == 3) {$to = "07967xxxxxx";}
else if ($smsaddress1 == 4) {$to = "07811xxxxxx";}
else if ($smsaddress1 == 5) {$to = "07970xxxxx";}
else {$to = "07775xxxxxx";}
echo "Sent to ",$to;
// auth call
$url = "$baseurl/http/auth?user=$user&password=$password&api_id=$api_id";
// do auth call
$ret = file($url);
// split our response. return string is on first line of the data returned
$sess = split(":",$ret[0]);
if ($sess[0] == "OK") {
$sess_id = trim($sess[1]); // remove any whitespace
$url = "$baseurl/http/sendmsg?session_id=$sess_id&to=$to&text=$text";
// do sendmsg call
$ret = file($url);
$send = split(":",$ret[0]);
if ($send[0] == "ID")
{echo "Your request has been sent successfully<br><font color=#1A8AC9>message ID: ". $send[1];}
else
{echo "send message failed";}
} else {
echo "Authentication failure: ". $ret[0];
exit();
}
?>
This works fine on the hosting I use for testing, however when I move the script to the hosting package that the clients site is to be located on I get the following when I send a message:
Warning: file("http://api.clickatell.com/http/auth?user=xxxx&password=xxxxxxx&api_id=xxxxx") - No such file or directory in /home/d/i/dingsand/public_html/customsent.php on line 34
Authentication failure:
If I simply paste the url with the correct parameters in a href and click the link it sends!
Am I missing something stupid here on can someone put me out of my misery.
Thanks
PHPDeano