Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts

    pete_assert() Help

    Does anyone know what the pete_assert function does? I'm trying to use this code to do http asynchronous calling but it is erroring out on this pete_assert function. Fatal error: Call to undefined function pete_assert()

    What is that?

    Thanks

    PHP Code:
    function curl_post_async($url$params)
    {
        foreach (
    $params as $key => &$val) {
          if (
    is_array($val)) $val implode(','$val);
            
    $post_params[] = $key.'='.urlencode($val);
        }
        
    $post_string implode('&'$post_params);

        
    $parts=parse_url($url);

        
    $fp fsockopen($parts['host'],
            isset(
    $parts['port'])?$parts['port']:80,
            
    $errno$errstr30);

        
    pete_assert(($fp!=0), "Couldn't open a socket to ".$url." (".$errstr.")");

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

        
    fwrite($fp$out);
        
    fclose($fp);

    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #2
    New Coder
    Join Date
    Jan 2006
    Posts
    73
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Seems like a copy/paste prevention, but concept revealing snippet. That is definitely a custom function and I honestly doubt anybody here is going to have a clue on what it does.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •