The ereg function doesn't have the capability to test the age of the
person viewing your page. You have to depend on them to input their
age in some way.
Your answer depends on how your age is submitted. Assuming it is
submited as $_POST['age'], you could perhaps use ereg("0*[7-9]$",
$_POST['age']
Numbers are pretty easy. You could just do:
$age = (int)$_POST['age'];
if($age > 9) do_something();
else do_something_else();
Using ereg doesn't make much sense in this case.
-Rasmus
On Fri, 31 Dec 2004, Michael Lutaaya wrote:
> I want to validate someones age. How do I do this in
>
In article <002e01c0e46c$ec2459a0$6e00a8c0@webdesign>,
[EMAIL PROTECTED] ("Jay Paulson") wrote:
> echo ereg("^[a-zA-Z]$", $fname);
>
> as you can see I'm just looking to make sure the variable $fname just has
> characters a-zA-Z and nothing else.
Actually, you're checking whethere the variabl
3 matches
Mail list logo