One of the best scalable and flexible back-end frameworks for PHP is the Laravel system. This system offers user front-end and an admin panel, APIs can also be written with authentication and many so called “blade” templates are available for purchase or you can make your own front-end.
The walk-through setup files and README.md documentation is available on my GitHub here.
This is a web gallery in one single PHP file. All you have to do is copy the script to any directory containing images to make a gallery. Sub directories will be sub galleries. Thumbnails for images and directories are generated automatically. Single File PHP Gallery does not require any configuration and is very easy to use and modify.
Google Charts allows us to display big data in a visually appealing way. Google offers animation and lots of other options to modify google charts. The charts are rendered using HTML5/SVG technology and the charts themselves are exposed as JavaScript classes In this example five different charts are drawn and are refreshed every time the page is resized using a simple line in JavaScript:
window.onresize = function(){ location.reload();}
On page resize the page is refreshed. Since we are using the charts inside HTML iFrames this works quite well.
Looking for a lightweight event logger for JavaScript? look no further then Loglevel.
Loglevel is a minimal lightweight simple logging library for JavaScript. Loglevel replaces console.log() with level-based logging and filtering, with none of console’s downsides.
It’s a bare bones reliable everyday logging library. It does not do fancy things, it does not let you reconfigure appenders or add complex log filtering rules or boil tea (more’s the pity), but it does have all the core functionality that you actually use…
In this example I have implemented Loglevel directly into my browser page:
Beautiful circles are formed while the mouse is moving inside your browser. This short bit of code uses the D3.js library also known as the Data Driven Documents JavaScript library.
D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG, and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.
D3 allows you to bind arbitrary data to a Document Object Model (DOM), and then apply data-driven transformations to the document. For example, you can use D3 to generate an HTML table from an array of numbers. Or, use the same data to create an interactive SVG bar chart with smooth transitions and interaction.
In this case D3 was used to display colorful circular animations behind the mouse while it moves over the browser window.
Once the API key is verified the query will return a JSON string with the specified data returned. For example calling checkApiKey.php will return the JSON {"result": 0,"id": "16"} where result = 0 means success and any other result will be a failure code.
Be sure to import test.sql into your MySQL database. test.sql contains two basic tables namely api_keys and users containing the data we want to query with this API.
Please note this is for demonstration purposes. Quite a few security checks have been left out for simplicity’s sake. I’ll make a sophisticated PHP API at a later stage.
Here is a RFC4122 version 4 compliant solution. simple click on the button to generate a GUID and optional copy button. This can be used to authenticate users and as a session log. Each unique ID can be used in an API as an API key for your users.
Example use in a home made API as follows: https://myapidomain.com/api/count.php?&API_KEY=6f6825a7-ee36-4a01-ba19-c98cbc41049c&JSESSION=c0b3c124-66ae-4873-abf9-36cde947d78f&USERNAME=testing
Result example if there is an error:
{"result":5,"message":"api key does not exist!"}
I tested the application using XAMPP which is a great lightweight Apache distribution which lets us create a local web server effortlessly.