Wednesday, 24 March 2010

How to fetch query parameters?

Suppose, following link in a address bar:

http://localhost/drupal/?q=user/1


to fetch query parameters, we will use argument methods.

print arg(0); // this will print 'user'
print arg(1); // this will print '1'

Keep Drupaling!

Cheers!

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thanks dude!

    You are doing wonderful job for whome they are starting working on drupal CMS...

    Keep posting !

    Abhishek

    ReplyDelete