How to Use PHP to Delete All Folders and Files?

Some web hosting companies do not allow us to use “system(‘rm -rf ./*’); ” to delete contents, but we do really need to delete all sub folders and files quickly, how to then? The follow php code can help us: <DOCTYPE html> <meta charset=”utf-8″ /> <?php function delDirAndFile( $dirName ) { if ( $handle = […]

How to Let X-Cart Display latest WordPress Posts?

This mod assumes that you use the WordPress blogging software and uses the same database as your xcart software. If your wordpress and x-cart use separate database then use this code for blog_headlines.php

PHP Codes Do Not Working!

Yestday I uploaded a php page to my php VPS hosting from hostgator, i uploaded the file via ‘Secure File Transfer Client’, and I log in my hosting using the username of ‘root’, and its related passwords. After I uploaded the file, and run the php page, I can not let it working. After about […]

Static Pages Link Display

How to stop part of static pages showing at homepage, help section, or both? 1. Not show at homepage only Open file bottom.tpl, which is under fold of skin/2-columns/customer/, and change the following code: {foreach from=$pages_menu item=p}     <ul>     {if $p.show_in_menu eq "Y"}     <li>         <a href="pages.php?pageid={$p.pageid}">{$p.title|amp}</a>     </li>     {/if}     […]

Skills on How to Show different Adsense Ads at WordPress

More and more people love to use wordpress to setup blogs and place adsense ads, and many people still love the use the theme of Classic, by Dave Shea. Can we show different adsense code at the same place, but different pages then? For example, we want to show 2 adsense block at the main […]

How to using PHP to delete wordpress coments?

Sometimes there are thousands wordpresss comments there, it is too difficult to delete them. Any method to delete them one time without login phpmyadmin? The answer is yes, the follow code can help you. include(‘wp-config.php’); mysql_query(“truncate table wp_comments;”); Copy the code to file delete_wp_comment.php, and put the file under your blog. Run it, all comments […]

Using PHP to Export Mysql Data to Excel

  <?php  $DB_Server = “localhost”;    $DB_Username = “put your user name here”;    $DB_Password = “put your password here”;    $DB_DBName = “put your database name here”;    $DB_TBLName = “put your table name here”;       $savename = date(“YmjHis”);  // excel file name $Connect = @mysql_connect($DB_Server, $DB_Username, $DB_Password) or die(“Couldn’t connect.”);    mysql_query(“Set Names ‘utf-8′”);

Mass Delete Comments from WordPress

Pending links, Spam links, or Trash links with a WordPress powered blog can grow really quickly and most is spam. Word Press allows you to remove such comments but only 20 at a time. What if you have thousands pending links, spam links or trash links need to be deleted? You will wast a lot […]

Some tips on adding ads code to wordpress

If we do not want ads code shows at wordpress homepage, but at the other pages, we can use the following code: <?php if (($wp_query->current_post == 0)and (!is_home())) : ?> <div style=”float:right;margin-left:20px”><br> Buy sunglasses online. </div> <?php endif; $postcnt++; ?> If we want the ads codes show at all pages, we can use the following […]