Incapsula is a WAF service from Imperva. The company that I currently work for, is one of their biggest customers. We use Incapsula to protect our public websites. Recently I had an opportunity to work on developing a single page app that can show us the live status of the domain enrollment so that we…Continue reading PHP code to check if a domain is enrolled in Incapsula WAF
Category: PHP
Fix WordPress Files & Folders Permission Massively On cPanel Server
chdir(“/var/cpanel/users”); $users = glob(‘*’); foreach($users as $user) { if(is_file(“/home/$user/public_html/wp-config.php”)) { echo “Performing on /home/$user/public_html\n”; system(“find /home/$user/public_html/ -type d -exec chmod 755 {} \; “); system(“find /home/$user/public_html/ -type f -exec chmod 644 {} \; “); } } Save the file as fix.php on /root Then execute it /usr/local/cpanel/3rdparty/bin/php /root/fix.php
PHP MySQLi Wrapper Class Complex WHERE
If you have ever had a chance to use a PHP active record class for MySQL, you would notice that most of them don’t support complex where statements. I’ve had a chance today to address this feature request that I was received from a user of my PHP MySQLi wrapper class. Adding a complex WHERE…Continue reading PHP MySQLi Wrapper Class Complex WHERE
PHP MySQLi Wrapper Class Update
Last December, I wrote a simple and easy to use PHP MySQLi wrapper class inspired from the simplicity of Code Igniter Active Record pattern and hosted on BitBucket. Over an year, I’ve been using this class and continuously improving it based on my requirements and other users requests. Over a dozen of bug fixes and…Continue reading PHP MySQLi Wrapper Class Update
Passing Zend Certification Exam, Here is the tip!
Yesterday, December 8th, 2014 I took the Zend Certification exam and passed. The latest version of the Zend exam is based on PHP version 5.5. They have updated their syllabus to reflect this change. And also, Zend made their official study materiel available to buy from their website for $19.95. It was available free of…Continue reading Passing Zend Certification Exam, Here is the tip!
PHP Snippt to get the changes caused by the UPDATE query
This is a simple trick to get the changes caused by the UPDATE query. The trick is to get a copy of the row before and after UPDATE query and compare those rows to get the changes. If you would like to go for something complicated than this one, then you should check the MySQL…Continue reading PHP Snippt to get the changes caused by the UPDATE query
Simple PHP Functions To Hash Passwords For Saving Into Database
This is a simple php function for hashing a plain text password so that it can be saved into the database securely. [gist id=”33fb2eb19d3517057b10″]
MySQLi Wrapper for PHP
I was very much interested in the database class of CodeIgniter, especially the Active Records. I was quite satisfied with an old mysql wrapper that I have been using for long time. But I’ve decided to start using MySQLi for all my future projects so started to write my own database wrapper for php. php.net…Continue reading MySQLi Wrapper for PHP
Fuse – Open Source Ticket Management System
Hey, I am glad to release a free and open source ticket management system – “Fuse”. Fuse is a simple ticket system which requires nearly zero configuration. It is built using CodeIgniter and Twitter Bootstrap frameworks. Fuse does not boast any special features. It is designed for small size organization with a couple of staffs…Continue reading Fuse – Open Source Ticket Management System
Find c99 Shell Scripts on cPanel Server
c99 Shell Scripts are one of the main headache for almost all cPanel server administrators even though they use mod_security and all. This small snippt would help you to find those possible shell script. You can open a new ‘screen’ session and execute the code and close the window. You can then have a nice…Continue reading Find c99 Shell Scripts on cPanel Server