Solving time difference between hosting server and local timezone in PHP

I think this is one of the common problem you’ll face while you’re working for the website of a particular country and web server is located in another different country. If client have the dedicated server then you won’t face this problem. But if you just own a single account of that server then you’ll most probably face this problem of synchronizing the time difference of server time and local time.

Hide actual url in address-bar using iframe

Do you want to hide the actual URL in the address-bar? Do you want to display the same url throughout the website? Then here is the tips for you do the same in your website. Just display the same URL i.e http://www.your-site.com throughout your website in address bar, no matter if you in the page http://www.your-site.com/aboutus.html.

Visible text “Password” instead of “********” in the password field

As you know, the user login box of the website contains the following fields username and password. Furthermore, most of them put the “Username” inside user name field and “********” inside password field to save the space within designing.In this post I’ll show you how to show “Password” text in the password field. It doesn’t actually does so but this tips will make it looks like so.

Email address validation in PHP

Well you’ve been asking why this person has posted the same stuff which you can find easily in google. Ya you are right you can get lots of scripts but many of them are not useful for me so far. They just validate the email like “info@yahoo.com” but they didn’t validate the email address like “contact@roshanbh.com.np” or even the address like “info@holmesglen.vic.edu.au“.

Hide .php extension with url rewriting using .htaccess

Last time I’ve written an article about hiding php file extension where I’ve showed you how you can use .html or .asp extension of file instead of .php extension. But there was one flaw in that technique you have had to change the file extension explicitly but in this post I’m going to show you how to rewrite the URL instead of renaming the file extension Using this technique you will see product.html in the address bar of the browser but the actual file name remains product.php and you don’t need to rename the file extension. Furthermore you can rewrite the URL like product.php?id=5 to product-5.html.

Php function to validate two decimal places of a number

If you are looking for the validation of a number which contains only two decimal places. Means you want to accept the values like 0.21 or 1.34 or 12.55 or 445.66 as a input and throw an error when somebody enters the number like 0.2 or 4.678 from a text box. Here is a simple function for you in PHP which validates the number weather it contains exactly two decimal places or not.

How to run a php file(script) automatically in a certain interval – Using Cron job

In your project you might have to run a function or script (.php) file automatically for a various reasons like automatic sending email on birthday or automatically close a auction when the end_time is reached. What to do in that situation? .To do these things automatically, you must have a php file which must contains the code and these files should be called automatically at certain certain time. So how to do that? The answer is Cron Job. Cron job are the cron tab command found in the UNIX or Linux system.

Now let’s see how can we call the file automatically at certain duration. Let’s suppose the duration is one hour, now I’ll show you how to setup the the cron-job of every one hour to run a PHP file automatically in the Cpanel of your website.

Slider Using PHP, Ajax And Javascript

Have you been searching for the slider script and implementing it in Ajax with PHP then you are in the right place buddy.Here is the post for you in which I’ve implemented javascript slider to work in Ajax using PHP. Ok let’s Begin it by creating the following tables in the database. Here is the mysql code to create the table named “tbl_slider” in database.

CREATE TABLE `tbl_slider` (
  `id` smallint(6) NOT NULL auto_increment,
  `slider_val` smallint(6) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM   ;