Re: How to use what the function returns?
From: Janwillem Borleffs (jw_at_jwscripts.com)
Date: 01/23/05
- Next message: Terje Slettebų: "Re: Nested classes in PHP?"
- Previous message: varois83: "How to use what the function returns?"
- In reply to: varois83: "How to use what the function returns?"
- Next in thread: Geoff Berrow: "Re: How to use what the function returns?"
- Reply: Geoff Berrow: "Re: How to use what the function returns?"
- Reply: varois83: "Re: How to use what the function returns?"
- Reply: varois83: "Re: How to use what the function returns?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 23 Jan 2005 23:16:53 +0100
varois83 wrote:
> Now below is the area in my code where I have to fit what that
> function returns but I can't do it. The "Text" field is the one that
> has to be checked for a certain length (Like $min = 1, $max = 100).I
> would like to point to the error.html file if checkLength returns
> false.
>
> $Text = $_POST['Text'] ;
> $email = $_POST['email'] ;
> $name = $_POST['name'] ;
>
> if (empty($name) || empty($email)) {
> header( "Location: error.html" );
>
if (!checkLength($Text, 1, 100) || empty($name) || empty($email)) {
....
}
BTW, there's more to form validation than used in this code (per example, it
will allow a single white space character to pass as a valid email address),
but you will probably get to this when you have learned more about PHP.
JW
- Next message: Terje Slettebų: "Re: Nested classes in PHP?"
- Previous message: varois83: "How to use what the function returns?"
- In reply to: varois83: "How to use what the function returns?"
- Next in thread: Geoff Berrow: "Re: How to use what the function returns?"
- Reply: Geoff Berrow: "Re: How to use what the function returns?"
- Reply: varois83: "Re: How to use what the function returns?"
- Reply: varois83: "Re: How to use what the function returns?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|