Archive for the ‘PHP’ Category

How to Change a Broken WordPress Theme Using PHPMyAdmin

 
Sometimes when editing .php files you will make a mistake and end up breaking your theme or sometimes you might upload a theme that is old and out of date or is just too problematic and it needs to be switched back to the twenty ten default theme.

Some times the following error may occur.

Change a Broken WordPress Theme 1
 
Here is an easy way to switch to the twenty ten default theme using PHPMyAdmin.
 
Step 1
 
Go into your cPanel and look for the Databases section and click on the phpmyadmin link.


 
Step 2
 
Select the database where your WordPress is stored.


 
Step 3
 
Select the ‘wp_options’ table from the menu on the left.

 

Read more »

How to Add Leverage Browser Caching in WordPress Website via .htaccess

 
Step 1
 
First you need to access your .htaccess file through cPanel by clicking on the File Manager. When the popup box appears, click on the Web Root option and make sure that the “Show hidden files” option is checked.
 

Add Leverage Browser Caching 1


 
Step 2
 
Open up your .htaccess file and paste the following directives at the top of the file:
 

Read more »

MySQL database export to pdf using PHP

 
To export whole database or whole table content we can use phpMyAdmin Export option but if you want to export some rows or any query result then we should perform some other way.
 
To create PDF file we should first download the FPDF Library – Click Here.
 
Copy the following code and create a new PHP file called exportpdf.php and paste the content into it or download the file – Click Here
 
Sample Output

Export PDF

Sample Code
 
<?php
require('fpdf.php');
$d=date('d_m_Y');
 

Read more »