[ Index ] |
|
Code source de SPIP Agora 1.4 |
1 <?php 2 /***************************************************** 3 * This file is part of Agora, web based content management system. 4 * 5 * Agora is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * 9 * Agora is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details (file "COPYING"). 13 * 14 * Copyright © Arnaud Martin, Antoine Pitrou et Philippe Rivière. 15 * List of authors detailed in "copyright_fr.html" file. 16 * E-mail : agora@sig.premier-ministre.gouv.fr 17 * Web site : http://www.agora.gouv.fr 18 *****************************************************/ 19 function &sendToHostNoHeader ($host, $port, $method, $path, $data, $useragent = 0) { 20 // Supply a default method of GET if the one passed was empty 21 if (empty($method)) 22 $method = 'GET'; 23 24 $method = strtoupper($method); 25 26 /* 27 $fp = fsockopen($host,$port); 28 29 if ($method == 'GET') 30 $path .= '?' . $data; 31 fputs($fp, "$method $path HTTP/1.1\n"); 32 fputs($fp, "Host: $host\n"); 33 fputs($fp, "Content-type: application/x-www-form-urlencoded\n"); 34 fputs($fp, "Content-length: " . strlen($data) . "\n"); 35 if ($useragent) 36 fputs($fp, "User-Agent: MSIE\n"); 37 fputs($fp, "Connection: close\n\n"); 38 if ($method == 'POST') 39 fputs($fp, $data); 40 41 $header_start = FALSE; 42 $header_end = FALSE; 43 */ 44 $line = implode('', file("http://$host:$port/$path?$data")); 45 /*while (!feof($fp)) { 46 $line = fgets($fp, 128); 47 if (ereg("^HTTP", $line)) { 48 $header_start = TRUE; 49 $header_end = FALSE; 50 } else if ($header_start && ereg("^[\n\r\t ]*$", $line)) { 51 $header_end = TRUE; 52 $header_start = FALSE; 53 } else if ($header_end) { 54 $buf .= $line; 55 } 56 }*/ 57 58 return $line; 59 } 60 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 14:40:03 2007 | par Balluche grâce à PHPXref 0.7 |