File: functions.inc

package info (click to toggle)
kannel 1.4.5-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,284 kB
  • sloc: ansic: 105,659; sh: 32,211; xml: 20,360; php: 1,103; perl: 711; makefile: 583; yacc: 548; awk: 133; python: 122; javascript: 27; pascal: 3
file content (35 lines) | stat: -rw-r--r-- 831 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

function http_send($URL,$port)
{
 $connection = fsockopen(BEARERBOX_HOST,$port,&$error_number,&$error_description,60);
 if(!$connection) {
  echo "<p>$error_description ($error_number)<br>\n";
  echo "The SMS message was NOT sent!</p>\n";
 } else {
  socket_set_blocking($connection, false);
  fputs($connection, "GET $URL HTTP/1.0\r\n\r\n");
  while (!feof($connection)) {
   $myline = fgets($connection, 128);
   switch($myline)
   {
     case (strstr($myline, 'Content-')): break;
     case (strstr($myline, 'HTTP/1')): break;
     case "": break;
     case "\r\n": break;
     default: echo "<p>".$myline."</p>";
   }
  }
  fclose ($connection);

 }
}

function octstr_append_cstr($mystring)
{
 for($pos=0;$pos<strlen($mystring);$pos++) {
  $mystring2 .= sprintf("%%%02x",$mystring[$pos]); 
 }
 return ($mystring2);
}
?>