a question about syntax

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Is it ok for me to name the form and the radiobutton   and the
function the same name or will that cause problems now or further down
the road?

Re: a question about syntax

plemon wrote:

Quoted text here. Click to load it

The name of your form is not important (from PHP's point of view, but it  
matters of course if you use JavaScript).

Since you can only submit 1 form at a time, PHP receives only 1 form, which  
you retrieve via $_POST[].

How your radiobutton is named is not important as long as you know it.

And functionnames declared in PHP couldn't care less about the names that  
populate your $_POST.

So as far as I can tell, go with it, but make sure you don't confuse  
yourself with all these same names. :-)

Happy coding!

Erwin Moller

On a sidenote: I wonder if the name of the form is send to PHP at all? Does  
anybody know how to retrieve that?

Re: a question about syntax

On Fri, 23 Feb 2007 17:45:51 +0100, Erwin Moller  

Quoted text here. Click to load it

No, only inputs, buttons and textareas are sent to the handling script.  
Which means that if you want to know the name of the form, you need to add  
it as an input. One solution for this is to change the name of the submit  
button so that it contains the form name. The submit button is sent when  
it's clicked or otherwise activated, and as it is an input, it is received  
by the handling script. You can retrieve it by testing for it using a  
switch(), or you can use the entire $_POST as an associative array.

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Site Timeline