$url_address = ""; //write url of your eshop, without http:// $to = "447971796595"; // number, in international format, no leading zeros or a “+” sign, e.g., 447971796595 $text = "hello world"; // SMS text $unicode = 0; // unicode yes=1, no=0 $type = "customer"; // admin x customer - senderID - from SMS settings TAB $status = ""; $query = "to=" . urlencode($to) . "&text=" . urlencode($text) . "&unicode=" . $unicode . "&type=" . $type; function URLopen($url) { return file_get_contents("{$url}"); } $data = @URLopen("http://" . $url_address . "/ossms/api/api.php?" . $query); if (!$data) { die("Not connected"); } else { $res = $data; if (preg_match("/SMSSTATUS:OK/i", $res)) { $status = "OK"; } if (preg_match("/SMSSTATUSERROROK:OK/i", $res)) { $status = "ERROR"; } } echo "status: " . $status; //print status of SMS sending
//write url of your eshop, without http:// $to = "447971796595"; // number, in international format, no leading zeros or a “+” sign, e.g., 447971796595 $text = "hello world"; // SMS text $unicode = 0; // unicode yes=1, no=0 $type = "customer"; // admin x customer - senderID - from SMS settings TAB $status = ""; $query = "to=" . urlencode($to) . "&text=" . urlencode($text) . "&unicode=" . $unicode . "&type=" . $type; function URLopen($url) { $dh = fopen("{$url}", 'r'); $result = fread($dh, 8192); return $result; } $data = @URLopen("http://" . $url_address . "/index.php?route=sms/api&" . $query); if (!$data) { die("Not connected"); } else { $res = $data; if (preg_match("/SMSSTATUS:OK/i", $res)) { $status = "OK"; } if (preg_match("/SMSSTATUSERROROK:OK/i", $res)) { $status = "ERROR"; } } echo "status: " . $status; //print status of SMS sending
<?php $returned = URLopen("http://facebook.com/"); function URLopen($url) { // Fake the browser type ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13'); $dh = fopen("{$url}", 'r'); $result = fread($dh, 8192); return $result; } echo $returned;