Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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

 
discard

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

Browse other questions tagged or ask your own question.