Thanks for your reply.
But I tried it and it seems to pass right through the if condition without
checking if the string is empty or not. Here is another PHP file where I
tried using the "empty" function
The input form contains the following:
<h2>QTY:</h2><input type="text" name="qty" size=7><br>
Here is the part that checks whether or not the user has pressed
"submit" and checks if "$qty" is empty or not:
if (isset($submit)){
if (!empty($qty))
{ echo "Please enter the quantity for your quotation enquiry.";}
When nothing was filled in for $qty the if condition did not prompt me to
enter a quantity.
Any suggestions?
thanks.
On Mon, 22 Oct 2001, CC Zona wrote:
> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Peter) wrote:
>
> > for example
> > if ($email =="")
> >
> > checks if the $email variable was inputted by the user.
>
> Better: if(!empty($email))
> <http://php.net/empty>
>
> > However I was wondering how can I refine it so that it will also check if
> > the $email variable contains an '@' sign?
>
> <http://php.net/strstr>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]