This form won't post and I can't figure out why. Can anyone spot the problem? The page this code is on is ndainvite.php, so it's posting to itself. I thought maybe it was a processing issue, so I pointed the form action at another page. It just doesn't post.
I tried removing the XHTML trailing slashes; I also eliminated all but one input until the form was uber simple. Nothing worked until I moved that H3 block. Then everything was fine. Thanks for the pointer on the label tags. Why is it bad to name the Submit button "Submit"?
08-23-2009, 05:03 PM
Because then the form would have a submit method and a submit property and sometimes that can confuse the browser.
08-24-2009, 12:11 AM
<div style="width:550px; margin:0 auto;>
You're missing the closing quotation mark on the inline style.
Also, if you are sending a form back to itself using php, I would suggest these two changes to your coding habbits:
No matter what page this form is on, it'll send back to itself. What happens when you move and/or rename this file, and forget to change the form?
don't rely on the php short tags <?= ?> as some servers might have those turned off by default, and then you code won't process, and you could end up exposing your code to the unwanted eye. Use the full php tags. <?php ?> it's not that much more effort to type the two additional character.
For debugging purposes, I like to use this at the top (or bottom) of my pages, when testing form or session transfers.
<pre> <?php print_r($_POST); ?> </pre>
This allows you to see exactly what is getting passed through, so it's easier to see what and where things are failing.