Re: checking for null form fields fails

From: Date: Tue, 07 Aug 2001 15:40:01 +0000
Subject: Re: checking for null form fields fails
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-61644@lists.php.net to get a copy of this message
On Tue, Aug 07, 2001 at 09:23:02AM -0600, mike cullerton wrote: > on 8/7/01 2:43 AM, Renze Munnik at renze@datalink.nl wrote: > > > On Mon, Aug 06, 2001 at 12:31:38PM -0700, Mark Maggelet wrote: > >> i can't tell if it's just a email formatting thing, but if there's a > >> line break in the onsubmit string it might mess things up. > > > > It no _might_ mess things up... It sure does! Good one. > > But... another thing. You just might want to consider using braces. > > They're not invented for nothing. When you call functions (like > > return) you should use braces. Especialy when you start writing more > > complex scripts, the not using any braces, is just the thing that > > may because a lot of trouble. > > a couple things. > > although i agree with the general notion of using braces, return is not a > function (the manual calls it a statement), and atleast from what i can find > in the manual it doesn't take braces. > > http://www.php.net/manual/en/functions.returning-values.php > > also from that page - "You can't return multiple values from a function, but > similar results can be obtained by returning a list." > > i'm not really sure what the difference is between function, statement and > language construct (which is what echo is). syntactically, i know that > functions require parentheses. > > with echo, the manual says you _cannot_ use parantheses if you are echoing > more than one thing. > > http://www.php.net/manual/en/function.echo.php > > -- mike cullerton > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net You're right, return is a statement. I never said, though, to use braces with echo. Actualy I didn't say anything about echo. I never use echo, for some weird reason I just don't like it. I prefer print. So... I don't realy care how echo should be used. But you'll have to admit, using braces makes things a lot easier. And because what this was all about was JavaScript (and not PHP), using braces is a smart thing, because in JavaScript you can make realy ugly constructions in which things _can_ go wrong (no syntax error, but _wrong_) if you don't use braces. In JavaScript it's not required to end each line with a semicolon like in PHP. This can cause weird flows if you also don't use braces. And ehhhh, who said anything about returning multiple values? To be honest... I don't understand what you try to achieve with your post.... Please let me know... -- * R&zE: -- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze@datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

« previous php.general (#61644) next »