function requestWithoutWaiting($url, array $params = array())
    {
        $post = array();

        foreach($params as $index => $val)
        {
            $post[] = $index . '=' . urlencode($val);
        }

        $post = implode('&', $post);

        $request = parse_url($url);

        // SUPPORT FOR RELATIVE GENERATOR URL
        if(!isset($request['host']))
        {
            $request['host'] = $_SERVER['HTTP_HOST'];
        }

        if(!isset($request['port']))
        {
            $request['port'] = $_SERVER['SERVER_PORT'];
        }

        // SEND REQUEST WITHOUT WAITING
        $protocol = isset($_SERVER['HTTPS']) ? 'ssl://' : '';
        $safePort = isset($_SERVER['HTTPS']) ? 443 : 80;

        // HTTPS WORKAROUND
        if($request['port'] == 80 && $safePort == 443)
        {
            $request['port'] = $safePort;
        }

        $fp = fsockopen($protocol . $request['host'], $request['port'], $errNo, $errStr, 60);

        $command  = "POST " . $request['path'] . " HTTP/1.1\r\n";
        $command .= "Host: " . $request['host'] . "\r\n";
        $command .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $command .= "Content-Length: " . strlen($post) . "\r\n";
        $command .= "Connection: Close\r\n\r\n";

        if($post)
        {
            $command .= $post;
        }

        fwrite($fp, $command);
        fclose($fp);
    }
function requestWithoutWaiting($url, array $params = array())
    {
        $post = array();

        foreach($params as $index => $val)
        {
            $post[] = $index . '=' . urlencode($val);
        }

        $post = implode('&', $post);

        $request = parse_url($url);

        // SUPPORT FOR RELATIVE GENERATOR URL
        if(!isset($request['host']))
        {
            $request['host'] = $_SERVER['HTTP_HOST'];
        }

        if(!isset($request['port']))
        {
            $request['port'] = $_SERVER['SERVER_PORT'];
        }

        // SEND REQUEST WITHOUT WAITING
        $protocol = isset($_SERVER['HTTPS']) ? 'ssl://' : '';
        $safePort = isset($_SERVER['HTTPS']) ? 443 : 80;

        // HTTPS WORKAROUND
        if($request['port'] == 80 && $safePort == 443)
        {
            $request['port'] = $safePort;
        }

        $fp = fsockopen($protocol . $request['host'], $request['port'], $errNo, $errStr, 60);

        $command  = "POST " . $request['path'] . " HTTP/1.1\r\n";
        $command .= "Host: " . $request['host'] . "\r\n";
        $command .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $command .= "Content-Length: " . strlen($post) . "\r\n";
        $command .= "Connection: Close\r\n\r\n";

        if($post)
        {
            $command .= $post;
        }

        fwrite($fp, $command);
        fclose($fp);
    }
function requestWithoutWaiting ( $ url , array $ params = array ( ) ) { $ post = array ( ) ; foreach ( $ params as $ index => $ val ) { $ post [ ] = $ index . '=' . urlencode ( $ val ) ; } $ post = implode ( '&' , $ post ) ; $ request = parse_url ( $ url ) ; // SUPPORT FOR RELATIVE GENERATOR URL if ( ! isset ( $ request [ 'host' ] ) ) { $ request [ 'host' ] = $ _SERVER [ 'HTTP_HOST' ] ; } if ( ! isset ( $ request [ 'port' ] ) ) { $ request [ 'port' ] = $ _SERVER [ 'SERVER_PORT' ] ; } // SEND REQUEST WITHOUT WAITING $ protocol = isset ( $ _SERVER [ 'HTTPS' ] ) ? 'ssl://' : '' ; $ safePort = isset ( $ _SERVER [ 'HTTPS' ] ) ? 443 : 80 ; // HTTPS WORKAROUND if ( $ request [ 'port' ] == 80 && $ safePort == 443 ) { $ request [ 'port' ] = $ safePort ; } $ fp = fsockopen ( $ protocol . $ request [ 'host' ] , $ request [ 'port' ] , $ errNo , $ errStr , 60 ) ; $ command = "POST " . $ request [ 'path' ] . " HTTP/1.1\r\n" ; $ command .= "Host: " . $ request [ 'host' ] . "\r\n" ; $ command .= "Content-Type: application/x-www-form-urlencoded\r\n" ; $ command .= "Content-Length: " . strlen ( $ post ) . "\r\n" ; $ command .= "Connection: Close\r\n\r\n" ; if ( $ post ) { $ command .= $ post ; } fwrite ( $ fp , $ command ) ; fclose ( $ fp ) ; }
Sends the POST request without waiting for a response.
@param string $url
@param array $params
Sends the POST request without waiting for a response .