cvs: phpweb /include posttohost.inc shared-manual.inc

From: Date: Sun, 23 Sep 2001 02:07:02 +0000
Subject: cvs: phpweb /include posttohost.inc shared-manual.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-6620@lists.php.net to get a copy of this message
jimw Sat Sep 22 22:07:02 2001 EDT Added files: /phpweb/include posttohost.inc Modified files: /phpweb/include shared-manual.inc Log: oops, forgot these Index: phpweb/include/shared-manual.inc diff -u phpweb/include/shared-manual.inc:1.121 phpweb/include/shared-manual.inc:1.122 --- phpweb/include/shared-manual.inc:1.121 Sat Sep 22 21:04:13 2001 +++ phpweb/include/shared-manual.inc Sat Sep 22 22:07:02 2001 @@ -174,8 +174,6 @@ }; function manualGetUserNotes($title, $id) { - // if we're www.php.net, get it from the local DB - // otherwise look in "/manual/usernotes/$title.txt" (if present) global $MYSITE, $DOCUMENT_ROOT; $notes = array(); $hash = substr(md5($id),0,16); @@ -218,7 +216,7 @@ echo "<tr bgcolor=\"#d0d0d0\" valign=\"top\">\n"; echo "<td><small>User Contributed Notes<br></small><b>$title</b><br></td>\n"; echo "<td align=\"right\">"; - print_link('/manual/add-note.php?sect='.$id.'&redirect='.$back_url, + print_link('../add-note.php?sect='.$id.'&redirect='.$back_url, make_image('notes-add.gif','add a note') ); echo "&nbsp;"; Index: phpweb/include/posttohost.inc +++ phpweb/include/posttohost.inc <?php function posttohost($url, $data) { $url = parse_url($url); if (!$url) return "couldn't parse url"; $encoded = ""; while (list($k,$v) = each($data)) { $encoded .= ($encoded ? "&" : ""); $encoded .= rawurlencode($k)."=".rawurlencode($v); } $fp = fsockopen($url['host'],$url['port']?$url['port']:80); if (!$fp) return "failed to open socket to $url[host]"; fputs($fp, sprintf("POST %s%s%s HTTP/1.0\n", $url['path'], $url['query'] ? "?" : "", $url['query'])); fputs($fp, "Host: $url[host]\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\n"); fputs($fp, "Content-length: " . strlen($encoded) . "\n"); fputs($fp, "Connection: close\n\n"); fputs($fp, "$encoded\n"); $line = fgets($fp,1024); if (!eregi("^HTTP/1\\.. 200", $line)) return; $results = ""; $inheader = 1; while(!feof($fp)) { $line = fgets($fp,1024); if ($inheader && ($line == "\n" || $line == "\r\n")) { $inheader = 0; } elseif (!$inheader) { $results .= $line; } } fclose($fp); return $results; }

« previous php.mirrors (#6620) next »