New Podcast

Posted Tuesday, January 31 at 3:28 pm
  Thomas Turnbull (tom_o_t on drupal.org) and Alan Palazzolo (zzolo on drupal.org) join Mike Anello to talk about their new book from O’Reilly Media, Mapping with Drupal. Mike’s usual co-hosts, Andrew and Ryan, were both unable to participate in the podcast, leaving Thomas and Alan subject to Mike’s long-winded (but extremely interesting by some accounts) questions.
Download Podcast 73
DrupalEasy_ep73_20120131.mp3
Syndicate content

NEWSLETTER

Stay informed on our latest news!

Syndicate content

Testimonial

The overall quality of DrupalEasy's webinar was top-notch. Using [online tools], the audio and visual was seamless, which let me focus strictly on absorbing new ways to leverage the power of Drupal. Thanks for a useful and efficient webinar, DrupalEasy!

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

Making Sure Your Redirects Work as Expected

Whenever you need to write a custom module that involves redirection using the drupal_goto() function, things can always get tricky - especially if there are other forces at work. One such force might be the "destination" variable that sometimes gets passed around in the URL querystring when the user is attempting to access content that requires authentication.

I recently ran across the situation where the "destination" querystring variable was interfering with where I was attempting to redirect the user to. Luckily, there was a simple solution - I just "unset" the "destination" variable right before I redirected the user:


unset($_REQUEST['destination']);
drupal_goto('somewhere_completely_different');

Using this method, I ensure that the redirect was "clean" and there wasn't any possibility of any misdirection.

Trackback URL for this post:

http://drupaleasy.com/trackback/204
No votes yet

More Quicktips


No comments

Guest wrote 1 year 29 weeks ago

Glad I found this!

Mike, you told me to try the goto function to redirect to a view page, and it just wouldn't work. But I could tell it was not returing to after the goto call, so I knew something was fishy. Adding the unset did the trick!

Syndicate content