Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to create link in Drupal 7 that will redirect me to the same page but with omitting "?arg=value" query fragment?

The following code doesn't work, as it always add ?arg=value.

<p><?php echo l(t('My Label'), 'views-page-url'); ?></p>
<p><a href="<?php echo $_GET['q']; ?>"><?php echo t('My Label'); ?></a></p>
share|improve this question
What is the URL of the page? What do you get as from l(t(My label'), 'views-page-url')? – kiamlaluno Nov 22 '12 at 14:43
I get url <a href="views-page-url">My Label</a> without "?arg=value" which is what I exactly want, but when I click it goes to views-page-url?arg=value. – f.gorczynski Nov 22 '12 at 14:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.