Re: cvs: qaweb / buildtest-action.php

From: Date: Mon, 26 Aug 2002 09:28:33 +0000
Subject: Re: cvs: qaweb / buildtest-action.php
References: 1  Groups: php.qa 
Request: Send a blank email to php-qa+get-5882@lists.php.net to get a copy of this message
count() returns int(1) on every variable that is set. So in this case count() is made not on array but on string. This always will be int(1). IMO the condition must be: if (count($_POST) > 0) Regards, Andrey ----- Original Message ----- From: "Jan Lehnardt" <jan@dasmoped.net> To: <php-qa@lists.php.net> Sent: Monday, August 26, 2002 12:01 PM Subject: [PHP-QA] cvs: qaweb / buildtest-action.php > jan Mon Aug 26 05:01:01 2002 EDT > > Modified files: > /qaweb buildtest-action.php > Log: > - "spam protection" > > > Index: qaweb/buildtest-action.php > diff -u qaweb/buildtest-action.php:1.3 qaweb/buildtest-action.php:1.4 > --- qaweb/buildtest-action.php:1.3 Wed Mar 20 13:43:00 2002 > +++ qaweb/buildtest-action.php Mon Aug 26 05:01:00 2002 > @@ -2,15 +2,16 @@ > include("include/functions.php"); > $TITLE = "Submit Build Test [PHP-QAT: Quality Assurance Team]"; > $SITE_UPDATE = date("D M d H:i:s Y T", filectime($SCRIPT_FILENAME))."<br> > -/* $Id: buildtest-action.php,v 1.3 2002/03/20 18:43:00 derick Exp $ */"; > +/* $Id: buildtest-action.php,v 1.4 2002/08/26 09:01:00 jan Exp $ */"; > > common_header(); > > $d = var_export ($_POST, TRUE); > - > - mail ("php-qa@lists.php.net", "PHP Test results", $d, "From: noreply@php.net"); > - > - print("thank you for your submission."); > - > + if (count($d) > 0) { > + mail ("php-qa@lists.php.net", "PHP Test results", $d, "From: noreply@php.net"); > + print("thank you for your submission."); > + } else { > + print("Your submission was empty, please try again."); > + } > common_footer(); > ?> > > > > -- > PHP Quality Assurance Mailing List <http://www.php.net/> > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.qa (#5882) next »