Software, your way.
How To Get Good Custom Software
(Download)
(PDF)
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

Keeping Image Location Secret

The URL of an image embedded in a web page may be kept secret.

Easier Reading of JSON Data

For easier reading of JSON data, convert the JSON into an array.

Fixed Position Image

Position an image within a browser window that won't move even with page scroll.

Visually Centering Images

Sometimes an image that is technically centered doesn't look quite centered when viewed.

Cookie Directory Protection

Protecting subdirectories with a cookie can be an especially good method when access needs to be allowed from various internet connections.

Check SSL Certificate

An easy-to-use SSL checker to see when your secure certificate expires.

Strong Form Protection From Bots

A web page form that is invisible to spam bots.

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