Software, your way.
burger menu icon
WillMaster

WillMasterBlog > Development

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Parameter Value Encoder

A URL parameter is the part that may follow the "?" character of a URL.

URLs contain certain reserved characters. The ":" and "/" characters are examples.

URL parameters also contain reserved characters. Examples are the "?" character to separate the location part from the parameter part of the URL, the "=" character to delimit the name and its value, and the "&" character to delimit name/value sets.

There are many reserved characters. When reserved characters occur as part of a parameter name or value, the character needs to be encoded. Encoding is done with a hexadecimal number preceded with a "%" symbol.

There's an encoder further below to help you.

Here are some examples of what I'm talking about.

Spaces encode as %20. Thus, Will Bontrager becomes Will%20Bontrager.

Because "/" and "=" are reserved characters, any of those in a name or value need to be encoded. The name Dad/Son becomes Dad%2FSon. The value two=one company becomes two%3Done%20company.

With the above as examples, let's look at a complete (and unencoded) URL that incorporates them. (The properly-encoded URL is further below.)

http://example.com?Dad/Son=two=one company&name=Will Bontrager

That URL would be confusing to a browser. The name and values with special characters need to be encoded.

To do that, take each name and value with non-alphanumerical characters in the URL parameter and run them through the encoder separately. It will encode the characters that need to be encoded. Reincorporate the encoded version into the URL.

You'll end up with this.

http://example.com?Dad%2FSon=two%3Done%20company&name=Will%20Bontrager

The encoder was built because, first of all, I was writing a chapter of an upcoming book (about links to take a payer directly to the PayPal payment page with amount and other information pre-filled in).

Second, I needed to URL-encode part of a link (a link that expires at a certain date and time) to use as an example in the book. It was then I realized how very handy an encoder would be if it was always and immediately available.

So, here it is :)

In this box, type in the URL part to encode. Then click the "Encode" button. The box below the button will contain the URL-encoded content you typed here.

The above box contains the URL-encoded content when the "Encode" button is clicked.

Will Bontrager

Was this blog post helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method


All information in WillMaster Blog articles is presented AS-IS.

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

Recent Articles in the Library

Extracting Dates From the Unix Timestamp

The UNIX timestamp can be used to determine the represented time for any time zone on Earth.

Submit Form Data Without Bothering User

To silently and effectively submit a form on a web page, Ajax with FormData() can be used.

CSS Dots

CSS dots can be used for interactions between web page and website user.

Email Testing

One thing to test when email doesn't get sent or doesn't arrive is whether the server actuall sends email.

Tap to Select

Find out how to make a link or button to select the content in a div or other HTML element.

Capitalizing the First Letter of Words

Here, find both PHP code and JavaScript code to capitalize the first letter of a word.

Fixed-position Table Header

During a vertical scroll, the table header scrolls out of view -- unless the header is fixed in position.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2024 Will Bontrager Software LLC