{"id":1519,"date":"2018-01-19T19:22:56","date_gmt":"2018-01-19T19:22:56","guid":{"rendered":"http:\/\/goofy-trucks.flywheelsites.com\/revisited-logging-with-php-page-2\/"},"modified":"2018-01-19T19:24:51","modified_gmt":"2018-01-19T19:24:51","slug":"revisited-logging-with-php-page-2","status":"publish","type":"post","link":"https:\/\/phpbuilder.com\/revisited-logging-with-php-page-2\/","title":{"rendered":"Revisited: Logging With PHP Page 2"},"content":{"rendered":"<div class=\"phpbuilder-content\">\n<div class=\"phpbuilder-meta\">\n<div class=\"\">By Tim Perdue<\/div>\n<div class=\"\">on December 10, 2000<\/div>\n<\/p><\/div>\n<div id=\"overflow-content\">\n<div class=\"articlePara\">\nThe next step was getting the info into the tables. It would be<br \/>\na perfect world if all pages were served through PHP and all of your<br \/>\nvarious web sites existed on one box. Unfortunately, I have an array<br \/>\nof servers scattered all over the country, and I want to collect this<br \/>\ninfo from every server for every page view 24 hours a day.<\/div>\n<div class=\"articlePara\">\nSo that required me to use the 1&#215;1 pixel GIF trick. I have a GIF<br \/>\non every page on every server that looks like this:<\/div>\n<div class=\"example\">\n<pre>\n&lt;IMG SRC=\"http:\/\/www.yourserver.com\/util\/gif11.php3?c=4&amp;s=phpbuildercom&amp;b=77\" \nheight=1 width=1&gt;\n<\/pre>\n<\/div>\n<div class=\"articlePara\">\n<b>gif11.php3<\/b> is a simple script that resides on my central server.<br \/>\nI have included the source on the next page.<br \/>\nSince the gif is on each page, and is forced to load due to the random<br \/>\nnumber at the end (the b=xxxx), a request is sent back to the central<br \/>\nserver for each and every page view.<\/div>\n<div class=\"articlePara\">\nIf all of your pages and the database reside on one server, you don&#8217;t<br \/>\nneed to use the GIF trick &#8211; you can insert the logging code into the<br \/>\nheader of your page.<\/div>\n<div class=\"articlePara\">\nHere&#8217;s a drawing demonstrating what&#8217;s going on here:<\/div>\n<div class=\"articlePara\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/phpbuilder.com\/wp-content\/uploads\/2018\/01\/tim20001211.gif\" alt=\"diagram showing flow of Database from Web Server to Web Browser &#10;to Central Server to Database\" width=\"300\" height=\"237\"\/><\/div>\n<div class=\"articlePara\">\nThere are 4 components in that drawing:<\/div>\n<div class=\"articlePara\">\n<ul>\n<li>Remote web server<\/li>\n<li>Web browser (user visiting that site)<\/li>\n<li>Central logging server<\/li>\n<li>Central database server<\/li>\n<\/ul>\n<\/div>\n<div class=\"articlePara\">\nSo the user visits the web server, gets a page get served up, and the browser<br \/>\nsees the 1&#215;1 gif and requests it from the central server. The central<br \/>\nserver then logs that information to make reporting easier.<\/div>\n<\/div>\n<p><\/p>\n<div style=\"float: left; padding:15px; color:#17AAF3\">\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"tim20001211.html\">\u00ab Previous Page<\/a><\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"tim20001211.html\">1<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"background-color:#B6E5FC; font-size:16px; margin-top:1px; padding:1px 4px 1px 4px; color:#000; font-style:bold; float:left;\">2<\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"tim200012119ba9.html?page=3\">3<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"tim20001211fdb0.html?page=4\">4<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"tim20001211af4d.html?page=5\">5<\/a> <\/div>\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"tim200012119ba9.html?page=3\">Next Page \u00bb<\/a><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>By Tim Perdue on December 10, 2000 The next step was getting the info into the tables. It would be a perfect world if all pages were served through PHP and all of your various web sites existed on one box. Unfortunately, I have an array of servers scattered all&#8230; <a href=\"https:\/\/phpbuilder.com\/revisited-logging-with-php-page-2\/\" class=\"readmore\"><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1519","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/comments?post=1519"}],"version-history":[{"count":1,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1519\/revisions"}],"predecessor-version":[{"id":2269,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1519\/revisions\/2269"}],"wp:attachment":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/media?parent=1519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/categories?post=1519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/tags?post=1519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}