Total members 11889 |It is currently Fri Mar 29, 2024 2:27 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Code:
<?php
   
// Establish a port 80 connection with www.example.com
   
$http = fsockopen("www.codemiles.com",80);

   
// Send a request to the server
   
$req = "GET / HTTP/1.1\r\n";
   
$req .= "Host: www.codemiles.com\r\n";
   
$req .= "Connection: Close\r\n\r\n";
   
fputs($http, $req);

   
// Output the request results
   
while(!feof($http)) {
      echo
fgets($http, 1024);
   }

   
// Close the connection
   
fclose($http);

?>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Open socket and read
 TCP socket in C++     -  
 java.net.SocketTimeoutException: Socket operation timed out     -  
 Client-Server-Data-datagram socket UDP protocol     -  
 Which open-source CMS is the best?     -  
 Open in a new window help     -  
 Unable to open OST file in C# [.net]     -  
 Open a link in a new window?     -  
 Open other application from java     -  
 Google adwords open in new window     -  
 How to open http connection using j2me     -  



Topic Tags

PHP Networking






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com