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“.

Ashutosh Pratap

By Ashutosh Pratap

I am software developer by profession and doing work and research in field of Computer programmings like PHP, WordPress, Magento, jQuery, Google APIs and many more web languages. Apart from this I write blogs on programming languages like PHP, Javascript, WordPress etc. I am also individual and independent Freelancer so you can hire me for your web work.

Leave a comment

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