Re: Value of $_POST['submit']
| From: | Fergus Gibson | Date: | Fri, 28 Nov 2008 22:58:00 +0000 |
| Subject: | Re: Value of $_POST['submit'] | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-45751@lists.php.net to get a copy of this message | ||
On Thu, Nov 27, 2008 at 5:02 PM, Ron Piggott <ron.php@actsministries.org> wrote:
> I am wondering how my PHP script may access the value of value of
> $_POST['submit']. At present echo $_POST['submit']; doesn't give me a
> value. Consequently all queries to the mySQL database fail.
Ron, is your AJAX request a POST? Is it actually assigning a value to
"submit"? It sounds like that datum is missing because it's not being
sent.
Steve is incorrect in suggesting that $_POST['submit'] will be
populated with data from an HTML input of type "submit". To achieve
the effect he is describing, you would need to add name="submit" to
that input. None of the keys of $_POST are magically populated. If
your request doesn't submit a variable named "submit", there will be
no such key in the array.