Tips & Tutorials – Javascript

5 Ways To Pass PHP Variables & Arrays To Javascript

Welcome to a tutorial on how to pass PHP variables and arrays to Javascript. PHP is server-side and JavaScript is client-side, so how do we gel them together? A quick and easy way to pass a variable from PHP to Javascript is to use the short tag. For example: <?php $PHPVAR = “FOO”; ?> var …

5 Ways To Pass PHP Variables & Arrays To Javascript Read More »

4 Steps GPS Tracking System With PHP and Javascript

Welcome to a tutorial on how to create a GPS tracking system with PHP and Javascript. Need to track where a vehicle is at? Where an order is, or just making sure that it has been delivered to the right place? A basic GPS tracking system with PHP and Javascript requires the following components: A …

4 Steps GPS Tracking System With PHP and Javascript Read More »

AJAX Long Polling – Simple Example With PHP MySQL

Welcome to a tutorial on how to do AJAX long polling. So you want to run a real-time application, but web sockets are too complicated? Or maybe you have heard of this long polling thing from somewhere and wondering what it does? To do long polling, we essentially set an AJAX request to repeat itself: …

AJAX Long Polling – Simple Example With PHP MySQL Read More »

Very Simple AJAX Examples With PHP (Free Code Download)

Welcome to a tutorial and examples of using AJAX with PHP. Yes, the Stone Age of the Internet is long over. If you are still doing “static HTML” or “submit form reload entire page” – It is time to explore the power of AJAX to spice up your website. AJAX stands for “Asynchronous Javascript And …

Very Simple AJAX Examples With PHP (Free Code Download) Read More »

Javascript CORS Fetch (Simple Example With XAMPP)

Welcome to a quick tutorial and example on how to perform a cross-origin fetch request in Javascript. Are you trying to do a fetch request to a different domain? Only to be denied with a “no Access-Control-Allow-Origin header is present” error? To perform a cross-origin fetch call: Run the fetch call “as-it-is”, CORS is already …

Javascript CORS Fetch (Simple Example With XAMPP) Read More »

Delete Files & Folders In NodeJS – Simple Examples

Welcome to a quick tutorial on how to delete files and folders in NodeJS. Need to remove some old or temporary files in Node? To delete files in NodeJS, we can use the unlink function. const fs = require(“fs”) fs.unlink(“PATH/FILE”, (error) => {}) fs.unlinkSync(“PATH/FILE”) To delete (empty) folders in NodeJS, we can use the rmdir …

Delete Files & Folders In NodeJS – Simple Examples Read More »