Link to home
Create AccountLog in
Avatar of PlumInternet
PlumInternet

asked on

HTML5 Post Requests Web Beacon Server Side

Hello,

We are looking to create a web beacon to pass parameters and values collected from a webpage as a post request. For example A JavaScript we will fire off a post request to with a parameter that has counted the number of time someone interacts with a button on a web page.

We were wondering how we could go about collecting this data server side, including the ability to pull values such as IP address from the request header

Our thoughts were to simply post the request to a 1x1 clear gif on a apache webserver and look at the web logs using a web log analyser.

As this is not a form we don't really want to use a database due to security and administration headaches.

Any ideas on how we could go about accepting and processing the post request server side?
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

An <img> tag is a GET link, not a POST.  You can do an AJAX post if you want but that doesn't require an image.  The server access logs will contain the IP address that the request came from along with the page or file requested and the 'user-agent' info.
Avatar of PlumInternet
PlumInternet

ASKER

Hi DaveBaldwin,

Thanks for the comment. We would prefer to use a POST request rather than a GET request to get around the data size limitations that come with a GET.

The idea if using weblogs is just simply an idea, if there is an easier way to collect and process the data passed in a POST request we would like to explore it.

Thanks
The web logs will only contain information on file requests, they will not contain any POST or GET info.  To receive any POST or GET info on the server and store it somewhere, you must use a programming language like PHP or ASP.  All the ways of collecting info from the user's browser are more complicated than you are requesting, not less.
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer