note 102248 added to function.curl-setopt

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
A note to zsalab's curl_exec_follow():

Sometimes the Location: header does not contain the FQN, so the function fails.

To solve this call 
    _getActServer($newurl, $actserver);
before each
    curl_setopt($rch, CURLOPT_URL, $newurl);
in his code and add one line to the beginning of the function
    $actserver = "";

<?php
function _getActServer(&$newurl, &$actserver) {
  preg_match('@^(?:http://)?([^/]+)@i', $newurl, $arr);
    if ($arr[0])
      $actserver = $arr[0];
    if (!$arr[0])
      $newurl = $actserver.$newurl;
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 79.228.215.130
----
Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php
Edit        -- https://master.php.net/note/edit/102248
Del: integrated  -- https://master.php.net/note/delete/102248/integrated
Del: useless     -- https://master.php.net/note/delete/102248/useless
Del: bad code    -- https://master.php.net/note/delete/102248/bad+code
Del: spam        -- https://master.php.net/note/delete/102248/spam
Del: non-english -- https://master.php.net/note/delete/102248/non-english
Del: in docs     -- https://master.php.net/note/delete/102248/in+docs
Del: other reasons-- https://master.php.net/note/delete/102248
Reject      -- https://master.php.net/note/reject/102248
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.