Showing posts with label tutorials. Show all posts
Showing posts with label tutorials. Show all posts

Tuesday, 7 July 2015

URL shortening : Removing .php - file extension


Most of the times when we are browsing php based website,  there we can see .php - file extensions associated with each page names ( Ex: http://yourdomain.com/about.php ). if you think this make your URL bit ugly, don't worry we can eliminate these extensions from our URL ( Ex: http://yourdomain.com/about ) . Here writing the procedure for removing ".php"  file extensions from URLs where our files are in Apache server.


Follow These steps for removing  ".php"  file extension from URLs

Step 1:
Create a .htaccess file (create a file and save this named " .htaccess").

Step 2:
Open this .htaccess file and paste the below code.

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}.php -f

RewriteRule ^(.*)$ $1.php

Step 3:
Save and move this file to the root directory of your website or application.

Step 4:
Done that's it.Now you can use files without extension in your Website.



How to Use the above feature in your existing Website

If you are already using files with .php extension in website (<a href=" http://yourdomain.com/about.php " > About </a> ) then you need to edit all the links appear in page without ".php"   file extension ( <a href=" http://yourdomain.com/about ">About </a>  ) .
Continue Reading →

Thursday, 25 June 2015

How to make select elements required in HTML5 ?




The <select > element is a form-control in HTML and is used to create a drop-down list in web pages.The <option > tags inside the <select > element define the available options in that drop-down list.

 HTML5 supports form input-attribute required="required" for input-type "text" to check the required input-fields.But its not applicable in case of select field. The following code showing how to make select elements required.

<select required>
<option value="">select an option</option>
<option value="value1">Value 1</option>
<option value="value2">Value 2</option>
</select>

View Demo on : http://jsfiddle.net/88rXX/
Continue Reading →

Popular Posts

Categories

browser (1) examples (1) facebook (1) Google (3) How to? (4) html5 (1) Microsoft (1) tutorials (2) VLC (1)

Follow My blog

Contributors

Ajesh VC . Powered by Blogger.