I am using Drupal 7 and have created a form using html, bootstrap css, and js. i have put this form in a block and it works perfectly. However, I am having problems when submitting the form. I have already made a custom module redirecting the user to my custom php file that prints and calculates inputs of users. But when a user submits the form, a new page opens that reads “error”(not 404). The page is however accessible when typing in the url which shows the callback function is working but since my custom php function is not getting anything from the form, it shows an empty page.
I am aware that this is not the drupal way to do it but I have no other choice and it’s mandatory to do it this way.
Would you help me find what I’m doing wrong?
Here’s a simplified version of my form:
`<form action="raw" method="post" target="_blank"> <input name="name" id="name0"/> <!-- A Bunch of input tags like this--> <input type="submit" value="submit"></input> </form>`
And here’s the custom module I have (in .module file)
<?php function dptools_menu() { $ items = array(); $ items['raw.php'] = array( 'title' => 'Custom call back', 'description' => 'Custom call back description.', 'page callback' => 'report', 'access arguments' => array('access content') ); return $ items; } function report(){ $ name = $ _POST["name"]; echo $ name; //A bunch of these and some calculations }
Thanks,