The script below works in PHP Version 4.1.2 but does not work in PHP Version 4.2.3 .
Can anyone help as to why?
I am getting desparate as all the scripts were tested on 4.1.2 and worked and I am moving the site to its live server and it does not work. - Help!
<?php
echo "Message reads - ",$message1,"<br>";
$message = "Email to SMS alert. ";
$message4 = ". Message sent at ";
$time= date("j, n, Y, H:i:s");
$user = "xxxx";
$password = "xxxxx";
$api_id = "xxxxx";
$baseurl ="http://api.clickatell.com";
$text = rawurlencode($message . $message1 . $message4 . $time);
if ($smsaddress1 == 1) {$to = "xxxxx";}
else if ($smsaddress1 == 2) {$to = "xxxxx";}
else if ($smsaddress1 == 3) {$to = "xxxxxx";}
else if ($smsaddress1 == 4) {$to = "xxxxxxx";}
else if ($smsaddress1 == 5) {$to = "xxxxxx";}
else {$to = "xxxxxxxx";}
echo "Sent to ",$to;
// auth call
$url = "$baseurl/http/auth?user=$user&password=$password&api_id=$api_id";
// do auth call
$ret = fopen($url, "r");
echo $ret;
// 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();
}
?>