This tutorial show you that how to display the total number of posts published on your WordPress blog. Although there are number of WpPlugins are available for stats, but what about creating your own stats for just Total Number of Posts as clean as original. This function is not by default in WordPress software. But we can get the job done by the following method.

There can be many other ways to do so but we use some simple way by using the $wpdb object to make a custom query to WordPress database.

{ read more }

, ,

It is easy to upload file when the Register_Globals are set to ON in the php.ini file (php configuration file) which is not recommended in any case for security reasons. When Globals are OFF then in this case I have tried this script and it works fine. Following is the script. Create two files. one html containing form and the other php file containing php script. This script will need a directory named as ‘img’ in root where this php script file is located according to the requirement of code. You can customize this code.

{ read more }

, , , , ,

by Hiroshi on November 2nd, 2008

Here is the list of ISO countries codes (2 Chars, 3 Chars, 3 Digit & Country Name).

{ read more }

, ,

by Hiroshi on October 30th, 2008

Following is the Time Zone list extracted from the Windows.

{ read more }

,

In your HTML directly link to the file which is to be downloaded.
i.e.

<a href="........./files/somefile.pdf">Download Pdf</a>.

You will get a pop-up box asking whether you want to save the file or open it normally.
Now you want to download it so open .htaccess file and write there some lines according yo your requirement mentioning extension of files which you want to download directly.

Place the following code into your .htaccess file.

{ read more }

,

by Hiroshi on October 27th, 2008

SMARTY – What & Why

SMARTY is a template engine for PHP. More specifically, it facilitates a manageable way to separate application logic and content from its presentation. This is best described in a situation where the application programmer and the template designer play different roles, or in most cases are not the same person.

{ read more }

,

If you have to create a date object of future or past, you can do it by using the second parameter of PHP date function. This is extremely useful when doing BETWEEN comparison in MySQL. You can build the date and bind it to query.

{ read more }

, , ,

by Hiroshi on October 20th, 2008

Following are the steps you need to take to create a new vhost in the XAMP.
Step 1 & 2 is once only and is needed if you have a fresh installation of XAMP.

1- Enable/Uncomment The following line in your /xamp/apache/conf/httpd.ini file
LoadModule vhost_alias_module modules/mod_vhost_alias.so

2- Open your /xampe/apache/conf/extra/httpd-vhosts file and uncomment following line
NameVirtualHost *:80

3- Now if you have to map a vhost for any of your new project. Add the following block of lines in the same httpd-vhosts file at the end. Remember to change these blocks to meet your DOMAIN name and DIRECTORY structure.

{ read more }

, ,

by Hiroshi on September 30th, 2008

With this PHP script you can find size and type (extension) of required file.

{ read more }

, ,

by Hiroshi on September 29th, 2008

.htaccess rules can be different for different hosts. This is file in root directory of website which defines certain rules for website behavior for some requests.

{ read more }