problems using file()
Posted: Sat Mar 29, 2003 10:55 am
I have a script I use for sending SMS messages through clickatell which was working fine but since I have moved to a different host server it does not work. This is on a Virtual host so I do not have access to change any setteing and they are quite security concious, so I doubt the will make any changes to php.ini
The problem seems to be with file command. The message I get is:
please find following code
Can you Help?
The problem seems to be with file command. The message I get is:
Warning: file("http://api.clickatell.com/http/auth?use ... id=xxxxxxx") - No such file or directory in /home/l/l/touch/public_html/support/desktop/jobconfirm.php on line 299
SMS Authentication failure:
please find following code
Code: Select all
<?php
if($smssend =="Yes")
{
if ($suser_mobile == "")
{"";}
else{
$suser_mobile = str_replace(" ","",$suser_mobile);
$baseurl ="http://api.clickatell.com";
$text = urlencode("New iTouch Job. Job $job_id has been created and assigned to you please log on to the iTouch Support Website to check details");
// auth call
$url1 = "$baseurl/http/auth?user=$smsuser&password=$smspassword&api_id=$smsapi_id";
// do auth call prblem line
$ret = file($url1);
// 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
$url2 = "$baseurl/http/sendmsg?session_id=$sess_id&to=$suser_mobile&text=$text";
// do sendmsg call problem line 2
$ret = file($url2);
$send = split(":",$ret[0]);
if ($send[0] == "ID")
echo "success<br>message ID: ". $send[1];
else
echo "send message failed";
} else {
echo "SMS Authentication failure: ". $ret[0];
exit();
}
}
}
else
{"";}
?>