Mailing List Archive



Back to the month index Back to the list index

David J. Hughes (bambi@Hughes.com.au)
Tue, 6 Apr 1999 14:49:29 +1000 (EST)


Date: Tue, 6 Apr 1999 14:49:29 +1000 (EST)
From: "David J. Hughes" <bambi@Hughes.com.au>
Subject: Re: urlEncode Problem
Message-ID: <Pine.BSF.3.96.990406143019.839B-100000@fawn.hughes.com.au>

On Fri, 2 Apr 1999, Warren Killian wrote:

> I have an HTML form where text can be entered into text fields. The
> action of that HTML form calls another web page that has a w3-msql
> script in it. The w3-msql script takes the values that were entered
> into the form, urlEncodes() them, then inserts them into the database.

I don't think you are using urlEncode() where you should be. The purpose
of urlEncoding a value is to allow you to pass it to another page as part
of the URL itself. So you may end up with something like ....

        <!
                $value = "Some value that nee'd encoding";
                $urlValue = urlEncode($value);
>
        <A HREF=somepage.msql?value=$value>

If you didn't urlEncode the original value it would be mangled when you
tried to read it in the second page (somepage.msql in the example).
w3-msql decodes the value and creates the variable automatically for you.

If you are using it to encode values before you insert them into the
database I think you are using the wrong function. You're probably
looking for msqlEncode() rather than urlEncode().

Bambi
...