Archive for the ‘php’ Category

Page 9 of 13« First...7891011...Last »

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. Full story

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. Full story

USA’s phone number validation using Regular expression in PHP

Last day i saw that one of my friend looking for the validation script in PHP which post the phone no (number) of USA from the text box and wanted to validate it from PHP in the following format. Full story

Register Globals ( register_globals ) “on” security problem in PHP

Do you know what happend when register_globals is set to ON in php.ini?? When it is set to ON it registers Environment, GET, POST, COOKIE or Server variables as global variables i.e. you don't need to write $_POST to access the posted 'username' variable you can simply use '$username' to access the $_POST. Full story

Absolute path and Relative path file inclusion in PHP

I think you guyz must be aware of absolute path and relative path in PHP. If you do not know anything about it then let me explain you about absolute path and relative path in the server with the example using include() function of PHP. You can see the example below, I've included the same files in PHP but the same file is included in two different manner. include("/home/example/public_html/config.php"); //absolute path include("config.php"); //relative path Full story
Page 9 of 13« First...7891011...Last »
Copyright © 2012 Roshan Bhattarai's Blog. All rights reserved.
Powered by WordPress.org, Custom Theme and ComFi.com Calling Card Company.