On Thu, 24 Jun 2004 21:53:21 -0400, Al <[EMAIL PROTECTED]> wrote:
>
> You need to be specific about what you consider to be a legitimate value
> for your application.
>
> consider:
>
> $var= $_GET['myname'];
>
> if((preg_match("/([0-9]|[a-z]|[A-Z]/", $var)) { Do something }
First, you have an
You need to be specific about what you consider to be a legitimate value
for your application.
consider:
$var= $_GET['myname'];
if((preg_match("/([0-9]|[a-z]|[A-Z]/", $var) { Do something }
No spaces and watch the "|" between the ] and the [
If $myname has at least one number or character, there
--- Anguz <[EMAIL PROTECTED]> wrote:
> Wouldn't this work?
>
>if(isset($_GET['var']) && !empty($_GET['var'])){
> // do something...
>}
No, he mentioned that he considers 0 to be acceptable, and this will fail
the empty() test.
Chris
=
Chris Shiflett - http://shiflett.org/
PHP
Terence wrote:
Hi,
Say you have a querystring - index.php?myname=joe
To determine whether myname has a value I have come to the following
conclusions / shortcomings when using one of the following:
ISSET = as long as the variable myname exists it's set, but there's no
guarantee of a value
!EMPT
4 matches
Mail list logo