Bulk Change Mysql Database Table Prefix

We often need to change all our mysql database table prefix. If there are only one or three tables, that would be very easy for us to change. If there are too many, say 100 mysql tatabase tables. It will take us a lot of time, at the same time we may make mistakes.

Any other easy way? The answer is YES. Here let me share my php code, using html5, and mysqli! (more…)

Posted in MySQL, Php Learning. Comments Off on Bulk Change Mysql Database Table Prefix »

WordPress SEO

We should take care the following points on wordpress seo:
1. meta title:
We shoud let wordpress shows different titles for homepage, page, post, categories, very simple, replace the original title related code to

<title><?php wp_title(‘&laquo;’, true, ‘right’); ?> <?php bloginfo(‘name’); ?></title>

2. page title
Save as meta title, we can use the following code:
<h1><a href=”http://www.glassesexperts.com/”><?php if ( is_single() || is_page() || is_category() || is_tag() ) { wp_title(”); } else { bloginfo(‘name’); } ?></a></h1> (more…)

Posted in Php Learning, WordPress. Comments Off on WordPress SEO »

Blocking access to the login page after three unsuccessful login attempts

Sometimes you need to add an extra protection to password-protected website. This article explains how access to the login page can be restricted after three unsuccessful login attempts. This schema uses visitors IP address to store log attempts in the database and block access to login feature for 30 minutes after third unsuccessful attempt.

(more…)

Posted in Php Learning. Comments Off on Blocking access to the login page after three unsuccessful login attempts »

How to remove the special characters in title?

< ?php $hotel=" How to study; PHP? "; $foldername = stripslashes ($hotel); //This erase white-spaces on the beginning and the end in each line of a string: $foldername = preg_replace('~^(\s*)(.*?)(\s*)$~m', "\\2", $foldername); //erases all NON-alfanumerics $foldername = ereg_replace("[^[:alnum:] ]","",$foldername); (more…)

Posted in Php Learning. Comments Off on How to remove the special characters in title? »

how to add php code in phpld, find current url?

It is very simple,just like this:

{php}
echo “PHP
“;
echo “I love PHP
“;
echo “included in .tpl
“;
{/php}

Find the Current URL with PHP (more…)

Posted in Php Learning, PHP Link Directory. Comments Off on how to add php code in phpld, find current url? »

Show random ads at phpld

If you’re looking for a simple static solution (an not an entire ad manager) use this
add in your init.php after the $tpl = get_tpl(… line (more…)

Posted in Php Code, Php Learning. Comments Off on Show random ads at phpld »

How to show all files under a document and rename the file names?

$dirname=”E:/zhanzhongjie/chengbiao-com/chengbiao-com”;
$dir_handle=opendir($dirname);
while($file=readdir($dir_handle))

{
echo $file.”
“;
rename(“E:/zhanzhongjie/chengbiao-com/chengbiao-com/”. $file, “E:/zhanzhongjie/chengbiao-com/chengbiao-new/insurance-“.$file);
}

closedir($dir_handle) (more…)

Posted in Php Code, Php Learning. Comments Off on How to show all files under a document and rename the file names? »

Remove hyperlinks ( A tag) from HTML

Sometimes we want to remove hyperlinks with anker text, sometimes only keep anker text, how to use php to achive this?

First, only remove hyperlink, and keep anker text part, the code is:

$text = ‘Test paragraph.’; (more…)

Posted in Php Learning. Comments Off on Remove hyperlinks ( A tag) from HTML »
King Php Science Welcome, you are from: 23.20.157.174