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

  • SEARCH
  • Home
  • 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 7666645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:53:08+00:00 2026-05-31T14:53:08+00:00

I have a URL that I’m passing through a jQuery ajax call (using encodeURIComponent)

  • 0

I have a URL that I’m passing through a jQuery ajax call (using encodeURIComponent) and decoding in PHP at the other end. I found what I thought to be a problem between rawurldecode() at the PHP end, but when using JUST PHP to rawurlencode() and rawurldecode() a test URL, I managed to get the same problem – can someone point out to me what I need to do here?

To reproduce:

$thing = rawurlencode("www.nzballet.org.nz?pa=thisthing&parmater1=23a&paramter2=another");
echo $thing;

This will produce:

http://www.nzballet.org.nz%3Fpa%3Dthisthing%26parmater1%3D23a%26paramter2%3Danother

If I then:

$rawurl = "www.nzballet.org.nz%3Fpa%3Dthisthing%26parmater1%3D23a%26paramter2%3Danother";
$decoded = rawurldecode($rawurl);
echo $decoded;

I get:

http://www.nzballet.org.nz?pa=thisthing&parmater1=23a¶mter2=another

This is the same output I got when passing between jQuery (ajax) and PHP, so it’s got nothing to do with that part of it. I have charset=UTF-8 specified in the HTML header – can someone enlightne me as to why I’m getting that weird character there?

Thanks!

  • 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-31T14:53:10+00:00Added an answer on May 31, 2026 at 2:53 pm

    It looks like your web browser is seeing &para and assuming you meant ¶, which is the entity for a paragraph symbol (¶). See https://meta.stackexchange.com/questions/100905/para-turns-into-within-pre for some more discussion on that issue.

    To get around it, encode your entities with htmlspecialchars before displaying them:

    $rawurl = "www.nzballet.org.nz%3Fpa%3Dthisthing%26parmater1%3D23a%26paramter2%3Danother";
    $decoded = rawurldecode($rawurl);
    echo htmlspecialchars($decoded);
    

    From the manual:

    Certain characters have special significance in HTML, and should be
    represented by HTML entities if they are to preserve their meanings.

    …

    ‘&’ (ampersand) becomes ‘&’

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a url that looks like that http://example.com/index.php?id=111&title=word1 word2 word3 I need to
I have a large url that I am encoding using System.Web.HttpUtility.UrlEncode. When I encode
I have an url like this: http://www.w3schools.com/PHP/func_string_str_split.asp I want to split that url to
I'm new to Rails (using 3.1) and am looking to have a URL that
I have a URL that is being generated using GET variables from a form
I have a url that looks like this http://example.com/index.php ?con=something&met=meh What i'm trying to
Suppose I have a url that has php style parameters, that is: http://example.com/blah?param1=val1&param2=val2 And,
i have a URL that looks like this ......index.php?option=com_jumi&fileid=8&Itemid=34 i know that i can
I have a url that I want to save, so I have my jquery
I have a URL that looks like this http://domain.com/index.php/view/test . How do i rewrite

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.