Welcome Guest, Not a member yet? Register   Sign In
Run another function in controller class - Background process
#18

[eluser]Ciaro[/eluser]
[quote author="tonanbarbarian" date="1197028875"]try something like this (totally untested)

you use fsockopen to make a connection to the url, writing the data of the request, then just close the socket without reading the reply

Code:
$fp = fsockopen("www.example.com", 80, $errno, $errstr, 30);
if (!$fp) {
  log_message('error', 'Unable to connect to server');
  return;
}
$request = "GET /SendSMS/index HTTP/1.1\r\n"
  ."Host: www.example.com\r\n"
  ."Connection: Close\r\n\r\n";
fwrite($fp, $request);
// normally now we would get the result like so
//$result = '';
//while (!feof($fp)) {
//  $result .= fgets($fp, 128);
//}

fclose($fp);
[/quote]

Great solution. Really helped me alot. Thanks for sharing!


Messages In This Thread
Run another function in controller class - Background process - by El Forum - 07-30-2008, 11:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB