Category: PHP Scripts
-
PHP 8.2 Error with Operand types
We did a host migration from php 7.4 to 8.2 and noticed some of our old scripts did not work throwing these errors After investigating the issue, we found the error was with type casting, which php versions above 8 are strict. This error occurs when you do math operations with string and int. An…
-
Tips to speed up WordPress website
Speed is a game changer with SEO and winning clients. It is absolutely important to speed up your website in mobile and desktop devices. To get the speed we have to go to the old school basics of html. With wordpress you have to strip everything out and eliminate the bloat, which is slowing down…
-
Php not executing html files
If you are using code in html file, chances are PHP versions 7+ may not be executing or running those code. You will see the site returning download as file or sometimes showing template code. How to fix this? I have had success with running PHP 5.5 or 5.6 versions and i added this code…
-
12+ Great PHP scripts for Dating websites
I have been long searching for a good quality premium dating software written in php. Lets take a look on some of the best out-of-box scripts that will help you to start a dating website instantly. Most scripts come with fully integrated features and 100% mobile responsive design. I will only list some of the…
-
Previous day and month date functions in PHP
If you are looking how to pull up the previous day or month from current date, it is very easy to do it in php. Look at the following pieces of code. This code will do the necessary conversions from one format to another. $old_date = “05-Dec-2015”; $new_date = date(“Y-m-d”, strtotime($old_date) ); $prev_date = date(“Y-m-d”,…
-
40+ Great PHP content management systems for your Website
PHP Content management systems (PHP CMS) are customizable plug and play scripts for organizing website content built on top of application frameworks and makes extensive reusable php code running on MySQL/PostgreSQL database powered by PHP. Each is CMS is unique and code simplicity, skeleton, customizing with plugins, snippets to your needs are most important to…
-
10+ Things to do when your server is down!
Is your website down? Are you in panic? Seeing a server down or terrible slowness, is a webmasters nightmare. I have often freaked out in such situations because with high traffic site, you could lose lots of clients, and money, if your site is slow or site down. Very often, when you press the panic…
-
PHP: Date difference in days between 2 dates
I was struggling to find a bit of code in php to compute the number of days between today and a given date. Here is the code you are after. Just simple use it or use it within a function $today_date = date(‘Y-m-d’); $datediff = round(abs(strtotime($today_date)-strtotime($date))/86400); If you want to use it as a…
-
PHP code to filter input against XSS/Injection attacks
Most php coded scripts are vulnerable to many hacks and mailicious code, just because many developers do not write code filtering and sanitizing user inputs, especially in forms using GET and POST. The golden rule is “Never trust user input”. Fortunately, it is very easy to implement the filtering mechanisms to guard against XSS and…
-
How to create page breaks in html/pdf pages?
I had this tricky issue. I use php to generate html page, but when i save as pdf, each page leak into another page which i didnt like. I wanted a code which inserts page break in html code so that the pages print nicely one by one. This code works nicely if you are…