MIME type
Moderator: General Moderators
One way could be to use a raw http/socket connection, e.g telnet to port 80 of the server and type
GET /web/path/filename HTTP/1.0
hit enter twice and get something like (this was http://www.ikke.no)
HTTP/1.1 200 OK
Date: Thu, 20 Mar 2003 06:01:16 GMT
Server: Apache/1.3.6 (Unix) (Red Hat/Linux) DAV/1.0.2 mod_ssl/2.3.11 OpenSSL/0.9.4 AuthMySQL/2.20 PHP/3.0.8
Set-Cookie: SaneID=141.149.250.37-1048140077746; path=/; expires=Thu, 20-Mar-08 07:01:17 GMT
P3P: policyref="http://secure.skiinfo.com/w3c/p3p.xml", CP="ALL DSP COR CURa DEVa OUR NOR UNI STA"
Last-Modified: Fri, 17 Sep 1999 15:12:32 GMT
ETag: "7b813-95-37e25a60"
Accept-Ranges: bytes
Content-Length: 149
Connection: close
Content-Type: text/html
<HEAD>
<TITLE>WebHotell kunder</TITLE>
</HEAD>
<BODY BGCOLOR=#000000 TEXT=#ffffff LINK=#800000>
<a href="http://www.webinfo.no/">WebInfo</a>
</BODY>
GET /web/path/filename HTTP/1.0
hit enter twice and get something like (this was http://www.ikke.no)
HTTP/1.1 200 OK
Date: Thu, 20 Mar 2003 06:01:16 GMT
Server: Apache/1.3.6 (Unix) (Red Hat/Linux) DAV/1.0.2 mod_ssl/2.3.11 OpenSSL/0.9.4 AuthMySQL/2.20 PHP/3.0.8
Set-Cookie: SaneID=141.149.250.37-1048140077746; path=/; expires=Thu, 20-Mar-08 07:01:17 GMT
P3P: policyref="http://secure.skiinfo.com/w3c/p3p.xml", CP="ALL DSP COR CURa DEVa OUR NOR UNI STA"
Last-Modified: Fri, 17 Sep 1999 15:12:32 GMT
ETag: "7b813-95-37e25a60"
Accept-Ranges: bytes
Content-Length: 149
Connection: close
Content-Type: text/html
<HEAD>
<TITLE>WebHotell kunder</TITLE>
</HEAD>
<BODY BGCOLOR=#000000 TEXT=#ffffff LINK=#800000>
<a href="http://www.webinfo.no/">WebInfo</a>
</BODY>
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
Code: Select all
<?
$document = "/bar.php";
$server = "vexdev.com";
$request = "GET $document HTTP/1.1\r\n";
$request .= "Host: $server\r\n\r\n";
$fp = fsockopen ($server, 80, $errno, $errstr, 30);
if (!$fp) { echo "$errstr ($errno)<br>\n"; } else {
fputs($fp, $request);
while (!feof ($fp)) {
$line = fgets($fp);
if(strstr($line, "Content-Type")){
echo $line; }}}
fclose ($fp);
?>