Change Hostgator MySQL Password

Sometimes we want to change hostgator mysql database user password, or we have to change when we forgot the password. How to do?

Very simple infact, first delete the user name of the mysql and remake it, but make sure you use exactly the same name when remaking.

then bind the old database name to the new database user name.

next modify the user password in your software config file, for example, if you use wordpress, you have to modify wp-config.php; if you use vbulletin forum, just modify config.php

Posted in MySQL, Vbulletin, WordPress. Comments Off on Change Hostgator MySQL Password »

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 time if you delete them via WordPress Blog own functions. Here we will teach you how to delete them via phpmyadmin! (more…)

Posted in Php Code, WordPress. Comments Off on Mass Delete Comments from WordPress »

explode and foreach to show strings or ASCII

//transfer ASCII to string

$string = “78b101b116b87b105b110b100”;
$tags = explode(‘b’, $string); 
foreach($tags as $key) { echo chr($key);  }
//transfer string toASCII
echo “<br><br>”;
$string = “Tiger Young”;
foreach($tags as $key) { echo ord($key).”b”;  }
echo “<br><br>”;

Posted in Php Functions, Php Skills. Comments Off on explode and foreach to show strings or ASCII »

wp-includes\taxonomy.php on line 1518

I am using XAMPP, and wordpress 3.0.4, today when I want to show all post, the following error message shows:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32768 bytes) in D:\xampp\htdocs\wp\specsexpert\wp-includes\taxonomy.php on line 1518 (more…)

Posted in Apache, WordPress. Comments Off on wp-includes\taxonomy.php on line 1518 »

WordPress Ad Code Skills

Sometimes we want our ads codes show differently at our wordpress blog. Say we want to show adsense codes different types at different place, say homepage, single post. Simple!

The following code will show your ad code one at single post and single page, and ad code two at other places: (more…)

Posted in WordPress. Comments Off on WordPress Ad Code Skills »

Old domain to new domain – different accounts

We can use the following code, and paste them in .htacess file:

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.old-domain.com$
RewriteRule (.*)$ http://www.new-domain.com/$1 [R=301,L] (more…)

Posted in Apache. Comments Off on Old domain to new domain – different accounts »

Category ID from current URL nicename and show some posts name

We can use the following code to get category ID from current URL nicename:
We can use the following code to get category ID from current URL nicename:
<?php
if(is_category() || is_single()){
 $category = end(get_the_category());
 $current =$category->cat_ID;
 $current_name = $category->cat_name;
}
echo $current_name . ” has id “.$current.” and is called “.$current_name;
;
?> (more…)

Posted in WordPress. Comments Off on Category ID from current URL nicename and show some posts name »

Show title at wordpress more tag

If we use the default wordpress more tag, then all posts will show a link with the word “more”, it is not so good for seo, because all the link words are the same: More, but they link to different pages with different content.

We can modify certain code to inforce wordpress “more” tag, we can add post title with more tag. There are two methods: (more…)

Posted in WordPress. Comments Off on Show title at wordpress more tag »

How to let non-www redirect to www domain?

Today I installed DEDECMS, a very popular PHP CMS open source system, I found I can not let non-www redirect to www domain. Say my domain is glassespeope.com, then I can not let http://glassespeople.com redirects to http://www.glassespeople.com. I tried to google, and found the following code can resovle the problems:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^glassespeople.com
RewriteRule (.*) http://www.glassespeople.com/$1 [R=301,L]

Save the above code in a .htaccess file, and upload this .htaccess to your web hosting root. Everything is OK!

Posted in Apache. Comments Off on How to let non-www redirect to www domain? »

How to use WordPress to design company site?

As we know that WordPress is very powerful, and Google likes it very much. If you can always publish quality contents for some months, I am sure Google will love your blog very much, and Google will index your new articles in minutes. That’s why more and more company come to use WordPress to design their business sites. (more…)

Posted in WordPress. Comments Off on How to use WordPress to design company site? »
King Php Science Designed by:KingPhp.com Welcome, you are from: 54.166.203.76