Hi,
I am new to php but an experienced embedded sw developer and I need to quickly cobble together a website in support of development work I am doing on an embedded project.
Basically I am working on a device which has to communicate to a customer website by sending data through an http POST. I don’t have access to the customer website and things are not working so I need to put up a test site on a local NAS so I can see what my embedded device is sending. The NAS incorporates a web server which has php and Apache so that is what I want to use. I have tested the php facility to the extend of including the stanza
[php]<?
phpinfo();
?>[/php]
in a page and it has the desired effect so I am confident I am good to go with this plan.
I already have my own website (just plain html) up on the NAS and intend to add an unlinked page that accepts the http POST and displays everything that the embedded device sends. The format the device sends is an http POST with a few fixed field names and the accompanying field data.
As an example (changing field names to protect the wicked the kind of data the embedded device will be sending is :
Field1=Hello&Field2=there&LastField=goodbye
only there will be quite a bit more data than that.
I have functions in the embedded device to URL encode the sent string but it should be understood that there is no web server nor browser in the device, the TCP stack is on a separate hardware module and all I can do is send via http POST which is one of several TCP/IP functions built into the module.
What I would like my web page to do is accept all http POST requests directed to it and to parse the field data and diaplay it in the appropriate part of the web page.
In addition I need the facility to display all the info that comprises the http POST request, headers, miscellaneous data from the socket and all. Basically any incoming data directed to that web page needs to be collected and displayed in ascii hex so that I can see what, if anything, is going wrong with the http POST requests my device is making.
I am completely new to php and know I have a lot to learn to do this, but if anyone can give me pointers as to which php commands can do what I need I’d be very grateful. Unfortunately this is a sideshow from the actual development work so I am not able to spend the time required to get an in-depth all round knowledge as I would like.
Many thanks,
Boo