James John – Software Engineer

Archives

Fun!

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 […]

My First Newbie Python Program

Just started my Python class few days ago and it’s pretty cooler compared to PHP, I just got to notice that Python doesn’t like long codes it wants everything short and simple still compared to PHP. Stuffs like: PHP: Is shorter and simple in Python: Am not a pro yet, am just that newbie 😀 […]

Setting Python3 as your Default Shell Python in Ubuntu

Default Ubuntu Python package version is 2.7, while in my Python class I use 3.4 and everything I keep typing python3 whenever I want to run python. Want to turn 3.4 to your default? Easy, BASH made this available by providing space for aliases in the config. Aliases is not only for this function, I […]

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 😀

Interprete and Parse Meta Robot Values Using PHP

Hey reader, you really need to see this PHP meta robots parser? So damn easy, now lets get our hands dirty ;). Am writing a function that interprets the meta robots which receives arguments of strings (e.g noindex,nofollow), you can grab this with the get_meta_tags() function then let me start the function to parse this.