View Single Post
Old 09-19-2003, 12:43 PM   #6
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. I believe the problem is that the script uses \n and your machine needs \r\n.

Please try this to fix the problem: First make a backup of the robot_functions.php file. Then in robot_functions.php, do the following:
  1. find:

    PHP Code:
    $auth_string 'Authorization: Basic '.base64_encode($components['user'].':'.$components['pass'])."\n"
    and replace with:

    PHP Code:
    $auth_string 'Authorization: Basic '.base64_encode($components['user'].':'.$components['pass'])."\r\n"
  2. find:

    PHP Code:
    $cookiesSendString .= "Cookie: ".$cookieString['string']."\n"
    and replace with:

    PHP Code:
    $cookiesSendString .= "Cookie: ".$cookieString['string']."\r\n"
  3. find:

    PHP Code:
    @ini_set('user_agent','PhpDig/'.PHPDIG_VERSION.' (PHP; MySql)'."\n".phpDigMakeCookies($cookiesToSend,$path)); 
    and replace with:

    PHP Code:
    @ini_set('user_agent','PhpDig/'.PHPDIG_VERSION.' (PHP; MySql)'."\r\n".phpDigMakeCookies($cookiesToSend,$path)); 
  4. find:

    PHP Code:
      $request =
      
    "HEAD $path HTTP/1.1\n"
      
    ."Host: $host$sport\n"
      
    .$cookiesSendString
      
    .$auth_string
      
    ."Accept: */*\n"
      
    ."Accept-Charset: ".PHPDIG_ENCODING."\n"
      
    ."Accept-Encoding: identity\n"
      
    ."User-Agent: PhpDig/".PHPDIG_VERSION." (PHP; MySql)\n\n"
    and replace with:

    PHP Code:
      $request =
      
    "HEAD $path HTTP/1.1\r\n"
      
    ."Host: $host$sport\r\n"
      
    .$cookiesSendString
      
    .$auth_string
      
    ."Accept: */*\r\n"
      
    ."Accept-Charset: ".PHPDIG_ENCODING."\r\n"
      
    ."Accept-Encoding: identity\r\n"
      
    ."User-Agent: PhpDig/".PHPDIG_VERSION." (PHP; MySql)\r\n\r\n"
  5. find:

    PHP Code:
    $req1 "HEAD $path HTTP/1.1\n"
    ."Host: $host$sport\n"
    .$cookiesSendString
    .$auth_string
    ."Accept: */*\n"
    ."Accept-Charset: ".PHPDIG_ENCODING."\n"
    ."Accept-Encoding: identity\n"
    ."User-Agent: PhpDig/".PHPDIG_VERSION." (PHP; MySql)\n\n"
    and replace with:

    PHP Code:
    $req1 "HEAD $path HTTP/1.1\r\n"
    ."Host: $host$sport\r\n"
    .$cookiesSendString
    .$auth_string
    ."Accept: */*\r\n"
    ."Accept-Charset: ".PHPDIG_ENCODING."\r\n"
    ."Accept-Encoding: identity\r\n"
    ."User-Agent: PhpDig/".PHPDIG_VERSION." (PHP; MySql)\r\n\r\n"

I think that's all of them that absolutely need to be changed. I also think you could just do a search and replace, changing all \n to \r\n in the files.

As a general rule of thumb, I believe it's like this for different OS:

Windows uses \r\n
Macintosh uses \r
*nix uses \n
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote