[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

socket fun & games

Not sure whether it is the place to ask this question open when I write the following to an open socket the response from the browser is to send me the page below. Any Ideas?
print $thesocket "HTTP/1.1 200 OK";
print $thesocket "Date: Wed, 18 Apr 2001 20:51:32 GMT";
print $thesocket "Server: Apache/1.3.14 (Unix) PHP/4.0.3pl1";
print $thesocket "Connection: Keep-Alive";
print $thesocket "Transfer-Encoding: chunked";
print $thesocket "Content-Type: text/html\r\n";
print $thesocket "f2a\r\n";
print $thesocket "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n<HTML><HEAD></HEAD><BODY><H1>Hello world</H1></BODY></HTML>"; 
print $thesocket "";
print $thesocket "O\r\n";
print $thesocket "\r\n";
close ($thesocket);
Maybe I am missing a Http closing statement?
The output
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>

Reply to: