Forum Moderators: coopster

Message Too Old, No Replies

How to catch submitted form data to a log?

I want to log site searches..

         

davidpbrown

5:42 pm on Mar 27, 2006 (gmt 0)

10+ Year Member



I have a simple form that sends search queries directly, as Get request, to your favorite search engine.

How can I catch these to a simple log file using PHP?

ChadSEO

9:53 pm on Mar 27, 2006 (gmt 0)

10+ Year Member



You could probably do something really complicated with Javascript, calling a page when the form is submitted. An easier way would be to have the form submit to a local file, which redirects to the search engine. The local file would simply have to log the request, either in a database or to a file, then return a 302 redirect to the search engine.

Chad

jatar_k

9:54 pm on Mar 27, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



send the request to a php script that logs it then redirect to the constructed url afterwards

davidpbrown

10:12 pm on Mar 27, 2006 (gmt 0)

10+ Year Member



Ah, of course! I'd got stuck wondering how php sends as Get.

I didn't recognise that Get is essentially a constructed url.

Thanks