Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6965055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:00:15+00:00 2026-05-27T16:00:15+00:00

I am having trouble properly encoding URL data. Using the following code: $redirect =

  • 0

I am having trouble properly encoding URL data. Using the following code:

$redirect = drupal_urlencode("user/register?destination=/node/1");
drupal_goto( $redirect );

but, the URL that comes up in my browser test is the following:

http://testsite.com/user/register%253Fdestination%253D/node/1

I thought using the drupal_urlencode function should fix this encoding issue. How can I fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:00:16+00:00Added an answer on May 27, 2026 at 4:00 pm

    You’d be better off using the built in url() function to create your URL, if you pass an array as the query parameter it handles URL encoding for you:

    $options = array(
      'absolute' => TRUE,
      'query' => array('destination' => '/node/1')
    );
    $redirect = url('user/register', $options);
    
    drupal_goto( $redirect );
    

    drupal_encode() will encode the whole string that you pass to it, so if you want to do it your original way it would look like this:

    $redirect = 'user/register?' . drupal_urlencode("destination=/node/1");
    drupal_goto( $redirect );     
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having trouble with the following segment of code. I'm getting a parameter count mismatch.
I having trouble in dividing the HTML frames. I have been using the following
I'm having trouble getting my user defined function operating properly. I am running on
I'm having trouble trying to properly insert additional code into the onclick attribute of
I'm having trouble getting a rotary encoder to work properly with AVR micro controllers.
I am having trouble getting my modal view controllers to display properly. I have
Having trouble linking the Stomp.framework into an iPhone SDK application. http://code.google.com/p/stompframework/ I follow the
Im having trouble using a .NET COM in vb6, It compiles ok and I
Having some trouble sending properly formatted HTML e-mail from a PHP script. I am
I'm having a bit o' trouble... Here is my mappings.xml file... <?xml version=1.0 encoding=utf-8?>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.