James John – Software Engineer

Archives

PHP

Simple PHP Mail Function Using Swift Mailer

Using the built-in mail() function is PHP is pretty cool but not cool if you’re sending bulk or large mails and secondly it always head for the Spam box 😀 because not all needed headers are there. But using a mailer, I use Swift Mailer and it’s cool for me, get Swift Mailer and also […]

ISO Alpha-2 Country Codes and Names in PHP Array

I sweated out arranging this but I think it’s gonna be useful to someone someday 🙂 This array can by handy if you create a function to get countries an HTML Option element and adding your selected, e.g below: I hope this helps 🙂

Securing Your AJAX Call-up Pages – Advanced

AJAX is cool, makes it able for you to do multiple things on a page without reloading and creating extra pages but how secure can it be? You may wish to run some actions on an AJAX page and without security even GoogleBot in the act of crawling your page executes the action. AJAX requests […]

Disable WordPress Cron and Use Real Cron Job

Normally, there is no way PHP can run without a page being loaded or without it being executed from CLI. So your WordPress cron how does it go about? Firstly what’s WordPress cron? What is Cron? Cron Jobs are software utility that can trigger a defined function based on time given to it, when you […]

Reducing Apache Memory Consumption – Process PHP with FastCGI

What is FastCGI? CGI are programme written to help the processing of Perl Language that has been written for the web and they also help the Web Server in processing requests and handling Webpages.

PHP Class: Online Guest Count System Using PHP

Here is what we’ve got here? A PHP Online Guest Class What Does This Do? This class saves any guest that visits your site saving some vital details about them, refreshing the time set and counting number of guests online How to Configure This: Firstly, set up your database connection by editing these lines of […]

Highlight PHP Codes with Line Numbers Using highlight_file () Function

PHP has an awesome function that highlights its own code, means you can highlight PHP codes using a function which is the PHP highlight_string () for string and highlight_file () for a PHP file. On using this function, the highlighted code never come with line numbers but in this post I’ll show you how I […]

5 Reasons Why I DON’T Use Frameworks in PHP

Weird right? But yes I don’t use frameworks and I am not thinking of using any in future. Ever since I started PHP and understood what is frameworks and what it does, I promised myself not to use and am still living with the legacy, friends told me if you don’t use it you can’t […]

Executing Commands through PHP (Linux & Windows)

Its amazing to see PHP interact with the Operating System, as we have Command Prompt in Windows and have the Terminal in Linux PHP can externally execute commands to it and return you the output or null if an error is found.

Why you should not use $_SERVER[‘REQUEST_URI’] and $_SERVER[‘PHP_SELF’]

Well, this might be a sad news for those who normally use 🙁 I once was a fan to it and use it quite well in form actions but realized that form actions can be null if its the same page. So i choose the easier one 😀