Get URL Variables

PHP Tricks provide a function which helps to get URL parameters using JavaScript. This is very easy function to quick edit.

Usage

Example URL:
http://www.demosite.com/index.php?mid=10&image_name=test.jpg

Calling getURLVariable("mid") – would return “10“.
Calling getURLVariable("image_name") – would return “test.jpg“.

Leave a Reply

Your email address will not be published. Required fields are marked *