ini_set("include_path", "..");
$TEMPLATE = array(
"section" => " :: URL encode tool",
"meta_description" => "Free online tool to encode and decode strings using the urlencoding or percent encoding format",
"meta_keywords" => "free, online tool, urlencode, percent-encode",
"cssfile" => array("/blog/projects/projects.css"),
);
include("header.php");
$MAXSTRLEN = 5000;
$msg = "";
if (strlen($_REQUEST["q"]) > 0 && strlen($_REQUEST["q"]) < $MAXSTRLEN) {
$b = "";
$action = "";
if ($_REQUEST["action"] == "Encode") {
$b = urlencode(stripslashes($_REQUEST["q"]));
$action = "Encoded";
} elseif ($_REQUEST["action"] == "Decode") {
$b = urldecode(stripslashes($_REQUEST["q"]));
$action = "Decoded";
} else {
$msg = "Unknown action '{$_REQUEST["action"]}'";
}
if (strlen($b) == 0) {
$msg = "Could not decode string";
} else {
$msg = "
URL Encode/Decode Tool
if (strlen($msg) > 0) { ?>
=$msg?>
} ?>
About this tool

At
the core of the web is the Hyper Text Transport Protocol (HTTP),
which
defines the way web browsers request content from web servers. Content is
addressed using a Uniform
Resource Locator (URL),
which defines a syntax that can easily be parsed.
However, sometimes you need to put additional information in a URL that
might be confused for other parts of the syntax. In those cases, you need
to use special escape sequences for those characters, which is called
URL encoding.
URL encoding simply replaces an character with a the following sequence:
%XX. XX is replaced with the ASCII index of that character.
For instance, the tilde character is URL encoded as %7E.
Use the form provided enter text to URL encoded or decoded.
If you have questions or comments, please email me at jjohn@taskboy.com
include("footer.php") ?>