{"id":18831500,"url":"https://github.com/maxbratuta/the-php-banner-app","last_synced_at":"2026-04-12T04:31:15.560Z","repository":{"id":182153273,"uuid":"667942644","full_name":"maxbratuta/the-php-banner-app","owner":"maxbratuta","description":"🖼 Pet-project for the tracking banner views app using vanilla PHP.","archived":false,"fork":false,"pushed_at":"2023-07-18T22:59:42.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T07:08:32.470Z","etag":null,"topics":["composer","css","html","js","mysql","no-frameworks","php","php8","sql"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxbratuta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-18T16:43:36.000Z","updated_at":"2023-07-18T22:11:24.000Z","dependencies_parsed_at":"2023-07-18T22:56:50.841Z","dependency_job_id":null,"html_url":"https://github.com/maxbratuta/the-php-banner-app","commit_stats":null,"previous_names":["maxbratuta/the-php-banner-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbratuta%2Fthe-php-banner-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbratuta%2Fthe-php-banner-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbratuta%2Fthe-php-banner-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbratuta%2Fthe-php-banner-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxbratuta","download_url":"https://codeload.github.com/maxbratuta/the-php-banner-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239768925,"owners_count":19693760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","css","html","js","mysql","no-frameworks","php","php8","sql"],"created_at":"2024-11-08T01:54:37.689Z","updated_at":"2025-12-30T23:00:35.327Z","avatar_url":"https://github.com/maxbratuta.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The PHP Banner App\n\n🖼 Pet-project for the tracking banner views app using vanilla PHP.\n\n![The PHP Banner App](https://i.ibb.co/Jv9K4VG/image.png)\n\n\n## Project Task Overview\n\n**Task**: Create an application that tracks banner views while displaying pages with a banner. The application should record user data and viewing time **without using any frameworks**.\n\nThe project should contain a minimum of 4 files:\n- index1.html\n- index2.html\n- banner.php\n- scheme.sql\n\nThe MySQL table structure should have the following mandatory columns:\n- _ip_address_\n- _user_agent_\n- _view_date_\n- _page_url_\n- _views_count_\n\n\nThe **index1.html** and **index2.html** pages should have an image tag that inserts some image into the page using **banner.php** file: _\u003c img src=\"banner.php\" \u003e_\n\nEvery time the image is loaded, the page visitor's info should be recorded in the MySQL table:\n- IP address of the visitor (_ip_address_ column);\n- Their user-agent (_user_agent_ column);\n- The date and time the image was shown for this visitor (_view_date_ column);\n- URL of the page where the image was loaded (_page_url_ column);\n- Number of image loads for the same visitor (_views_count_ column).\n\nIf a user with the same IP address, user-agent, and page URL hits the page again, the _view_date_ column has to be updated with the current date and time, as well as _views_count_ column has to be increased by 1.\n\n## Installation Overview\n\n**1. Install prerequisites.**\n- nginx\n- php-fpm 8.0\n- mysql 8\n- composer\n\n**2. Clone project.**\n\n```sh\ngit clone git@github.com:maxbratuta/the-php-banner-app.git\n```\n\n**3. Configure nginx.**\n```sh\nserver {\n\n    listen 80;\n    listen [::]:80;\n\n    server_name the-php-banner-app;\n    root /var/www/the-php-banner-app/public;\n    index index.php index.html index.htm;\n\n    location / {\n        try_files $uri $uri/ /index.php?$query_string;\n    }\n    \n    location ~ \\.php$ {\n        try_files $uri /index.php =404;\n        fastcgi_split_path_info ^(.+\\.php)(/.+)$;\n        fastcgi_pass php-fpm_8.0:9000;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n}\n```\n\n**4. Create MySQL database and tables.**\n\nRun `visitors-scheme.sql`.\n\n**5. Run install script.**\n\nRun next command to install external libraries.\n```sh\ncomposer install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxbratuta%2Fthe-php-banner-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxbratuta%2Fthe-php-banner-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxbratuta%2Fthe-php-banner-app/lists"}