note 57577 deleted from function.header by nlopess
| From: | nlopess@php.net | Date: | Sat, 08 Oct 2005 18:21:54 +0000 |
| Subject: | note 57577 deleted from function.header by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96690@lists.php.net to get a copy of this message | ||
Note Submitter: expertphp at yahoo dot com
----
For more features using JavaScript XML HTTP Request Object components (AJAX), visit this page : http://expert.no-ip.org/?ajax
example.php
<?php
require_once 'Ajax.php';
// header information
$headers[] = array("TEST1", "test one");
$headers[] = array("TEST2", "test two");
// javascript code
$cmd[200] = "alert({ajax})";
$cmd[404] = "alert('Error 404 - File not found !')";
$obj = new Ajax;
// get test.php body source using method GET
$obj->request("test.php", "GET");
// set header information
$obj->headers($headers);
?>
<html>
<head>
<?=$obj->head();?>
</head>
<body>
<?=$obj->get($cmd);?>
Example1.php
</body>
</html>
test.php
<?php
// print header information HTTP_TEST1 & HTTP_TEST2
echo "HTTP_TEST1: ".$_SERVER['HTTP_TEST1']."\n".
"HTTP_TEST2: ".$_SERVER['HTTP_TEST2'];
?>