php7.2: the each() function is deprecated

The each() function is deprecated under php7.2. If we run the following code we will get errors: <?php $arr=array( ‘glasses1’ => ‘reading glasses’, ‘glasses2’ => ‘bifocal glasses’, ‘glasses3’ => ‘progressive glasses’ ); while(list($key,$val)=each($arr)){ echo $key.’—>’.$val.'<br>’; } ?>   Deprecated: The each() function is deprecated. This message will be suppressed on further calls in E:\xampp\htdocs\index.php on […]

Zen Cart V1.5.5 Add Extra Text at Category Footer

Modify mysql database, add a field called ‘categories_footer’ at the table of ‘categories_description’, same field names and description of the field called ‘categories_description’. Add the function at admin panel, to create or modify a category, we need to modify categories.php which is under the admin fold. Within this file we need to add an extra […]

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 […]

Vbulletin Version 4.1.2 Installation Errors

When I install Version 4.1.2, the following errors come out: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/cpgtxos/public_html/ on line 414 Warning: Cannot modify header information – headers already sent by (output started at /home/cpgtxos/public_html/ in /home/cpgtxos/public_html/ on line 731

How to Access MySQL Command Line in XAMPP?

MySQL binaries should be under your XAMPP folder. Look for a /bin folder, and you’ll find the mysql.exe client around. Let’s assume it is in e:\xampp\mysql\bin, then you should fireup a command prompt in this folder. First, go to e:\xampp, and run xampp_start. If you do not run xampp_start first, the error message “Can’t connect […]

Using PHP to Generate Strong Password

If you want to have very strong password to protect your account, here is the code for : <code> <?php   function generatePassword($length=9, $strength=0) {     $vowels = ‘aeuy’;     $consonants = ‘bdghjmnpqrstvz’;     if ($strength & 1) {         $consonants .= ‘BDGHJLMNPQRSTVWXZ’;     }     if ($strength & 2) {         $vowels .= “AEUY”; […]

How to chang Vbulleting Domain Name?

Sometimes we want to change vbulleting forum domain name, here are some tips on how to do: 1. Before you change your old domain name to your new domain name, login into you cpanel, go to vBulletin Options, Choose Site Name / URL / Contact Details, and change your Forum URL to your new forum […]

How to Get the Current Page URL

Sometimes, you might want to get the current page URL that is shown in the browser URL window. For example if you want to let your visitors submit a blog post to Digg you need to get that same exact URL. There are plenty of other reasons as well. Here is how you can do […]

How to usp php to ban ip

First build a database table: CREATE TABLE `su_lockip` (   `id` int(4) NOT NULL auto_increment,   `lockip` varchar(1024) default NULL,   PRIMARY KEY  (`id`) )  Second, design a page so that you can add the ip you want to ban, every ip is devided by |,  I only write the mail part:   $UlockIp=$_POST[‘z’]?$_POST[‘z’]:”;  if(empty($UlockIp)){   […]