Current location: Hot Scripts Forums » Programming Languages » PHP » Adding data to HTTP header


Adding data to HTTP header

Reply
  #1 (permalink)  
Old 01-05-05, 04:20 PM
perleo perleo is offline
Coding Addict
 
Join Date: Jul 2003
Location: Ireland
Posts: 269
Thanks: 0
Thanked 0 Times in 0 Posts
Adding data to HTTP header

Can i add anything to a http header using header(), or is it just predefined data like Location.

I want to add an MD5 encrypted string of data..
Reply With Quote
  #2 (permalink)  
Old 01-05-05, 05:28 PM
mikaelf mikaelf is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: php[dot]net
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
you can find the answer in main/SAPI.c

regards,
__________________
Useful PHP links:
bugs.php.net - for reporting PHP bugs
pear.php.net - PHP extension and application repository
pecl.php.net - get non standard PHP modules, submit yours
www.phpclasses.org - PHP classes repository
Reply With Quote
  #3 (permalink)  
Old 01-06-05, 04:24 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
as long as the HTTP header are valid, you could use it ,,
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #4 (permalink)  
Old 01-06-05, 09:40 AM
perleo perleo is offline
Coding Addict
 
Join Date: Jul 2003
Location: Ireland
Posts: 269
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by mikaelf
you can find the answer in main/SAPI.c

regards,
okay, i want to send data to the client adn the client send it back, that possible do you know?

is it possible to get PHP to read the contents of a header?
Reply With Quote
  #5 (permalink)  
Old 01-06-05, 09:47 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
use fsockopen(), fputs() and fgets() and you can read and send headers!
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #6 (permalink)  
Old 01-06-05, 10:53 AM
perleo perleo is offline
Coding Addict
 
Join Date: Jul 2003
Location: Ireland
Posts: 269
Thanks: 0
Thanked 0 Times in 0 Posts
looking at the http request and respond, php sends the data i want over my custom header SERT, but how do I get the clients browser to send it back?

Will fsocketopen() get the clients browser to send exactly what I sent back?
Reply With Quote
  #7 (permalink)  
Old 01-06-05, 06:24 PM
perleo perleo is offline
Coding Addict
 
Join Date: Jul 2003
Location: Ireland
Posts: 269
Thanks: 0
Thanked 0 Times in 0 Posts
okay,

i'll try the functions in php, but my packet sniffer doesnt show up what I send and then script keeps loading (the bar doesnt complete)

PHP Code:

<?php


 $http_open 
fsockopen("192.168.0.105"80$errno$errstr30);

 if (!
$http_open) {
   echo 
"$errstr ($errno)<br />\n";
} else {
  
   
#send the new header
   
$send "SERT: string_here\r\n";

   
fput($http_open$send);
   while (!
feof($http_open)) {
       echo 
fgets($http_open128);
   }
   
fclose($http_open);
?>
how do I pick out the header contents and parse it down to just one line, that begins with SERT
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem getting data from DataGrid on update petersza ASP.NET 5 10-19-04 11:37 PM
writing/reading binary data oddolsen PHP 1 01-26-04 04:20 PM
Adding form data to DB error tbig ASP 13 01-15-04 04:39 PM
adding data darkcarnival PHP 6 07-04-03 12:41 PM


All times are GMT -5. The time now is 05:24 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.