Login   Register  
PHP Classes
elePHPant
Icontem

File: democlassheaders.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Martin Fasani  >  HTTP Request class  >  democlassheaders.php  >  Download  
File: democlassheaders.php
Role: Example script
Content type: text/plain
Description: Demo of the class reading headers (using proxyhead.php helper script)
Class: HTTP Request class
Generate Javascript to send HTTP AJAX requests
Author: By
Last change:
Date: 2005-08-23 03:55
Size: 913 bytes
 

Contents

Class file image Download
<?
/*
Author : Martin Fasani [ www.movil.be ]
lastMod: 20050701 [YYYYMMDD]
EXAMPLE of reading headers.
*/
require("classhttpreq.php");

$req3 = new httpreq('req3'); 
$req3->getheader='ALL';  //ALL or name e.g. "Last-Modified"
$req3->httpdorequest('HEAD','http://microsoft.com');
$req3->httpfireonload();
$req3->httpcreate();

$req4 = new httpreq('req4'); 
$req4->getheader='ALL';  //ALL or name e.g. "Last-Modified"
$req4->httpdorequest('HEAD','proxyhead.php?url=http://microsoft.com');
$req4->httpcreate();

?>
<div id='req3' style='overflow: auto; width:100%; height: 180px;border:1px solid'></div> 
<a href=javascript:httpdoreq3() >httpdoreq3() Note this is without using proxy, will give a JS alert (because you are requesting other domain)</a> 
<div id='req4' style='overflow: auto; width:100%; height: 180px;border:1px solid'></div> 
<a href=javascript:httpdoreq4() >httpdoreq4()</a>