RFH : Send & Receive Data Via HTTP Header
Posted: Thu May 19, 2005 12:46 am
Hi,
I am trying to send & receive data via http header. Normally i use querystring (i'm from asp background), but the requirements comes from SMS gateway company, and my client want me to write in php.
Trying to understand how the header work, i wrote 2 php page, sender.php and receiver.php. The sender will carry customer data in the header, and receiver will capture and save this data into mysql database. After days of experimenting, i still couldnt figure out how to add the customer data into the sender.php headers and how to get the received header data in the receiver.php.
Here is the simple experimental codes.
sender.php
receiver.php
Sadly, the receiver just print out the x-powered thing instead of AdditionalData1 value.
I will appreciate any help. Thank you.
I am trying to send & receive data via http header. Normally i use querystring (i'm from asp background), but the requirements comes from SMS gateway company, and my client want me to write in php.
Trying to understand how the header work, i wrote 2 php page, sender.php and receiver.php. The sender will carry customer data in the header, and receiver will capture and save this data into mysql database. After days of experimenting, i still couldnt figure out how to add the customer data into the sender.php headers and how to get the received header data in the receiver.php.
Here is the simple experimental codes.
sender.php
Code: Select all
<?php
header("AdditionalData1: This is the data");
header("Location: receiver.php");
?>receiver.php
Code: Select all
<?php
print_r(headers_list());
?>I will appreciate any help. Thank you.