By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

a question about syntax

P: n/a
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?

Feb 23 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
plemon wrote:
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?
Nope.
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!

Regards,
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?
Feb 23 '07 #2

P: n/a
On Fri, 23 Feb 2007 17:45:51 +0100, Erwin Moller
<si******************************************@spam yourself.comwrote:
>
On a sidenote: I wonder if the name of the form is send to PHP at all?
Does
anybody know how to retrieve that?
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/
Feb 25 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.