We have the form from where we need to access the values through a php code written.
But $_POST is not working in drupal.
We need to know how to access all the submit values in php, please can anyone help us ?…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Is this a form rendered in Drupal and also read from Drupal? Then it’s easy with the FAPI. You just need to add a submit callback to the form.
If it’s your own module’s form, just create another function with
_submitsuffix, likemymodule_form_function_submit. If it’s someone else’s form you will need to implementhook_form_alterand have it add your submit callback like so:Then simply implement the callback function.
Using Drupal’s built in Form API has the added benefit of separate validation from business logic. This means you can also add a validate callback, just like you addeed a submit one. If the validate callback calls
form_set_error()then your submit callback won’t even get called and so it can safely rely on having proper data.