Mailing List Archive



Back to the month index Back to the list index

Fernando Maior (fmaior@upol.com.br)
Wed, 14 Apr 1999 10:14:02 -0300


Message-ID: <3714949A.AF07AE7B@upol.com.br>
Date: Wed, 14 Apr 1999 10:14:02 -0300
From: Fernando Maior <fmaior@upol.com.br>
Subject: Re: Validation with HTML

Hi List, Hi Bambi,

I would like to have a documentation on those undocumented features :-)

Also, there are two functions on PHP that should be so nice to have in
Lite... They are AddSlashes and SplitSlashes, and they (respectively)
add/remove slashes before characters like quote, double quote, slash and
NULL in a string, in order to us use that string in a query to mSQL.

May be there is one undoc func already...

Bye,
Fernando Maior

Warren Killian wrote:

> CSM30005 wrote:
> >
> > Hi all,
> > I have a database running that is displaying information to a
> > web page and also letting people enter information back to the
> > database.
> >
> > I was wondering was there any way throught MSQL or HTML that I
> > could stop them from entering text where there should be number
> > and vise versa.
> >
> > Thank
> > Brian
>
> Hi Brian,
>
> If you users are entering information into an HTML form, perhaps a
> JavaScript could validate that the value entered is a numeric value.
>
> There is an undocumented function in Lite/w3-msql called "typeof()" that
> returns that data type for a given value. You might be able to use it
> to check the type of value that was entered. At least you could cast
> the entered value to an integer and then confirm that it is an integer
> before inserting it into your database. It works something like:
>
> $variable /*The value passed to your script. */
> $variable = (int)$variable /*Cast the variable to an integer*/
> $type = typeof($variable);
> echo("Variable is type: $type.");
>
> Hope this helps.
>
> --
> Thank you,
> Warren Killian
> Web Specialist, MIS Dept.
> Wishard Health Services
> 1001 W. 10th St.
> Indianapolis, IN 46202
> killianw@wishard.edu
> Ph: 317.630.8954