1. 개념 fsockopen 함수를 사용하여 구현한다. 2. 소스 DEFINE("CONTENT_TYPE", "multipart/form-data; boundary="); DEFINE("CRLF", "\r\n"); DEFINE("CONTENT_DISPOSITION", "Content-Disposition: form-data; name=\"%s\""); DEFINE("FILE_NAME_PLACE_HOLDER", "; filename=\"%s\""); DEFINE("CONTENT_TYPE_PLACE_HOLDER", "Content-Type: %s\r\n\r\n"); DEFINE("CONTENT_LENGTH", "Content-Length: %d\r\n"); DEFINE("BOUNDARY", "---------------------------" . "020603111835686"); function http_form_get_send($host, $port, $url, $result_len) { $headers = array( "GET $url HTTP/1.0" . CRLF, "Accept: */*" . CRLF, "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)" . CRLF, "Host: $host" . CRLF, "Connection: Close" . CRLF, ); $sock = fsockopen($host, $port); // send headers for($i = 0;$i < count($headers);$i++) { fputs($sock, $headers[$i]); } // send end of header fputs($sock, CRLF); while(!feof($sock)) { $s = fgets($sock, 1024); if($s) { // skip headers if($s[0] == "\n" || $s[0] == "\r") break; } else break; } $result = fread($sock, $result_len); fclose($sock); return $result; } 3. 사용 예 $data = "?ownerid=blue"; $data .= "&ticket=5230315"; $data .= "&from=016"; $data .= "&to_number=016"; $data .= "&message=hohoho"; $result = http_form_get_send("ipager.test.co.kr", "80", "/sendsms/" . $data, 1024) ; print "result : " . $result; |
4. 소스파일
'Computer > PHP, ASP' 카테고리의 다른 글
CakePHP #1 - 설치 (0) | 2011.08.02 |
---|---|
PHP - HTTP GET Request 구현 (1) | 2007.08.09 |
JSP - Tomcat에서 JNDI 사용하기 (Tomcat 4.1.29 / HP-UNIX) (0) | 2005.07.10 |
PHP - PHP Extension 만들기 (0) | 2005.07.10 |
ASP - Base64 Encode/Decode 함수 (0) | 2003.11.05 |
ASP - FileSystemObject Hang 발생 해결 방법 (0) | 2002.11.19 |
ASP - 기본 정리 (0) | 2002.11.11 |
ASP - Rs.GetString() 이용 방법 (0) | 2002.11.04 |
ASP - 특정 페이지를 통해서만 접근 할 수 있는 페이지 만들기(이전 url 알기) (0) | 2002.10.28 |
-
barato timberland 2012.12.25 12:30
United claims that they are just doing what nearly eight other airlines have done, http://www.timberlandbaratas.com barato timberland. They are saying that this is for the comfort of other passengers. Representatives from United said that they had over 700 complaints from passengers who were made uncomfortable because the person next to them was a little too close for comfort.With the population of the United States growing larger, http://www.timberlandbaratas.com zapatos timberland, it would seem that many airline seats have gotten smaller, http://www.timberlandbaratas.com timberland niños. In an effort to pack as many passengers into a plane, http://www.timberlandbaratas.com timberland, coach seats are just a little over 17 inches. You can still find seats that are around 19 inches, http://www.timberlandbaratas.com Mujer Timberland, but most domestic carriers tend to have the 17 inch seats.Still, many opponents to this are just saying it, http://www.timberlandbaratas.com timberland españa?s another way for United to make money in a tough economy. They say that seats should be made to fit the population and that the seats just need to be made bigger.Learn more about airline industry news and controversies at blog.flyhub.Related articles:
http://neoone.kr/category/頂勲攴鸽灅氚嶊磤霠�page=2 La mission de conseil juridique menée à Abidjan auprès de Laurent Gbagbo par les avocats fran
http://bspfp.pe.kr/?page=4 Planning a trip to