W3C home > Mailing lists > Public > www-talk@w3.org > November to December 2003

RE: Sending special characters

From: Gonšalo Silva Dias <gsdias@netcabo.pt>
Date: Thu, 4 Dec 2003 00:06:38 -0000
To: "WWW" <www-talk@w3.org>
Message-ID: <EXCH01SMTP03PB2EWrO0002fda8@smtp.netcabo.pt>

Tks, that was what I want to ;-)

GSDias
-----Original Message-----
From: www-talk-request@w3.org [mailto:www-talk-request@w3.org] On Behalf Of
Ian Clelland
Sent: quarta-feira, 3 de Dezembro de 2003 19:50
To: www-talk@w3.org
Subject: Re: Sending special characters


On Sat, Nov 29, 2003 at 12:56:24PM -0000, Gon?alo Silva Dias wrote:
> Hi ppl,
> 
> How can I send characters in the url like
> http://parede.hn.org/index.php?info=?
> 
> Anyone knows how to do that?


If you need to include reserved characters, such as "?", ";" or "/", in a
URL query part (the bit after the first '?'), you have to encode them.  You
can send any ASCII character in a URL by encoding it as "%hh" where "hh"
is the hex value for the character code. For example, "?" encodes as "%3f",
and "%" encodes as "%25".

Your example, then, would be a proper URL like this:
http://parede.hn.org/index.php?info=%3f

If you are using PHP to construct your URLs, use the function
urlencode() on your strings before including them in the URL. (see
http://www.php.net/manual/en/function.urlencode.php for more details)

Hope this helps,

Ian Clelland
<ian@veryfresh.com>
Received on Wednesday, 3 December 2003 19:09:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 October 2010 18:14:28 GMT