How can i get entity headers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tonyf
Forum Newbie
Posts: 2
Joined: Sat Oct 16, 2004 11:37 am

How can i get entity headers

Post by Tonyf »

Dear All,

i appreciate your hints to the following:
a client is sending an URL to the server f.e. "GET /index.php?info&id=xxxxxxx&comp=AL......"
With QUERY_STRING i can extract the command (info) and all other parameters (id,comp...).
The client sends a command create&id=xxxxx$comp..... and immediately some entity headers with infos like x-comp: data; content-type: application/xxx; ..... and immediatley the data.
Again i can filter the command and the parameters. But pls how to get all following entity headres and the data.
I tried with several functions like getallheaders() but i get only the request headers .... I need to parse the entity headers.
I have PHP4,Apache.
Thanks a lot for your help !

Regards,
Tony
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

not really sure what you want, i once wanted to handle xml posts from xml, and the parsing didn't really put the thingies i wanted in $_SERVER, $_POST etc... So i found

Code: Select all

$data = file_get_contents('php://input');
to return the whole request.
Tonyf
Forum Newbie
Posts: 2
Joined: Sat Oct 16, 2004 11:37 am

Post by Tonyf »

Thanks for your reply.
Unfortunately this dows not work.
I give you more info:

Here is an extract of a port scanner program, which captures the data from the client:

POST /test.php?create&contRep=T1&docId=40AB HTTP/1.0

Content-type:multipart/form-data; boundary=KoZIhvcNAQcB
Connection: close
Content-Length: 5216

--KoZIhvcNAQcB
Content-Disposition: form-data; filename="data"
X-compId: data
Content-Type: application/x-test
Content-Length: 4919

data data data ...........

As you can see after the request headers the entity headers follow then the data.
I need to parse the entity headers (data properties) and save the actual data in a file.
Can apache pass these infos to the php script !

Any idea.
Thanks again
Tony
Post Reply