Hi,
How do i check with ereg() is a string is non-empty (!== '')
Thx
G
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ernest E Vogelsinger wrote:
At 01:01 24.02.2003, Robert E. Harvey, M.D. said:
[snip]
if (is_numeric($_POST["gamt_$i"]) or empty($_POST"gamt_$i"))
or this:
if (is_numeric($_POST["gamt_$i"]) || empty($_POST"gamt_$i"))
I get this error message (my if stat
At 01:01 24.02.2003, Robert E. Harvey, M.D. said:
[snip]
> if (is_numeric($_POST["gamt_$i"]) or empty($_POST"gamt_$i"))
>
>or this:
>
> if (is_numeric($_POST["gamt_$i"]) || empty($_POST"gamt_$i"))
>
>I get this error message (my if statement is on line 5):
>
John W. Holmes wrote:
I'd like to verify input data transferred from a form and make sure it
is numeric data or null before my program executes. I am using this
syntax, which doesn't work:
for ($i=1;$i<=3;$i++)
{
if (ereg('[0-9]+','$_POST["gamt_$i"]'))
{
continue;
}
else
{
die("Non-nu
> I'd like to verify input data transferred from a form and make sure it
> is numeric data or null before my program executes. I am using this
> syntax, which doesn't work:
>
> for ($i=1;$i<=3;$i++)
> {
> if (ereg('[0-9]+','$_POST["gamt_$i"]'))
> {
>continue;
> }
> else
> {
>
Change to:No, the double quotes are needed so that $i will be parsed.
The problem is the single quotes around $_POST["gamt_$i"].
if (ereg('[0-9]+',$_POST["gamt_$i"])
Greg Donald wrote:
On Thu, 20 Feb 2003, Robert E. Harvey, M.D. wrote:
I'd like to verify input data transferred from a form
bruary 20, 2003 12:34 PM
To: php; Robert Harvey
Subject: [PHP] simple ereg question
Hello folks,
I'd like to verify input data transferred from a form and make sure it
is numeric data or null before my program executes. I am using this
syntax, which doesn't work:
for ($i=1;
On Thu, 20 Feb 2003, Robert E. Harvey, M.D. wrote:
>I'd like to verify input data transferred from a form and make sure it
>is numeric data or null before my program executes. I am using this
>syntax, which doesn't work:
>
>for ($i=1;$i<=3;$i++)
>{
> if (ereg('[0-9]+','$_POST["gamt_$i"]'))
> {
Hello folks,
I'd like to verify input data transferred from a form and make sure it
is numeric data or null before my program executes. I am using this
syntax, which doesn't work:
for ($i=1;$i<=3;$i++)
{
if (ereg('[0-9]+','$_POST["gamt_$i"]'))
{
continue;
}
else
{
die("Non-numeric
"]) || $_POST["gamt_$i"] == null){
}
Kelly
-Original Message-
From: Robert E. Harvey, M.D. [mailto:[EMAIL PROTECTED]]
Sent: February 19, 2003 6:54 PM
To: php
Subject: [PHP] Simple ereg question
Hello folks,
I'd like to verify input data transferred from a form a
Hello folks,
I'd like to verify input data transferred from a form and make sure it
is numeric data or null before my program executes. I am using this
syntax, which doesn't work:
for ($i=1;$i<=3;$i++)
{
if (ereg('[0-9]+','$_POST["gamt_$i"]'))
{
continue;
}
else
{
die("Non-n
11 matches
Mail list logo