felix7 Posted April 17, 2018 Share Posted April 17, 2018 (edited) Hello, I have my custom module, which one is a form, here it's the code: <div class="col-xs-12 col-md-4 form-index"> <h2><b>¿Quieres llevar a cabo tu propia idea?</b></h1> <h3>¡Contacta con nosotros!</h2> <form action="{$link->getModuleLink('worksform', 'validate')|escape:'html':'UTF-8'}" method="POST"> <div class="form-group"> <input type="email" class="form-control" id="email" placeholder="Email"> </div> <div class="form-group"> <input type="text" class="form-control" id="nombre" placeholder="Nombre"> </div> <div class="form-group"> <textarea class="form-control" id="idea" rows="4" placeholder="Explícanos qué tienes pensado"></textarea> </div> <div class="form-group"> <label for="file">¿Necesitas explicarlo con una imagen? ¡Mándanosla!</label> <input type="file" class="form-control-file hidden-xs-up" id="file"> </div> <button type="submit" class="button-form arrow md-width" id="submitWorkForm" name="submitWorkForm"> <span> Enviar </span> </button> </form> </div> When I click in the submit button, it redirects fine to controller (there I send an email and that works), but I cannot retrieve data, it doesn't work. I tried with: $email = Tools::getValue('email'); or $email = $_POST['email']; Any suggestions? Thanks in advance. Edited April 22, 2018 by felix7 (see edit history) Link to comment Share on other sites More sharing options...
tdsoft Posted April 18, 2018 Share Posted April 18, 2018 Please try to print data echp '<pre>' print_r($_POST); print_r($_REQUEST); Link to comment Share on other sites More sharing options...
felix7 Posted April 18, 2018 Author Share Posted April 18, 2018 (edited) hace 2 horas, tdsoft dijo: Please try to print data echp '<pre>' print_r($_POST); print_r($_REQUEST); This is the output: Array ( [file] => [submitWorkForm] => ) EDIT: I have another frontcontroller and it works nice, I use $_GET['id'] and that works fine. Edited April 18, 2018 by felix7 (see edit history) Link to comment Share on other sites More sharing options...
felix7 Posted April 22, 2018 Author Share Posted April 22, 2018 I figured out the error. It was that I dind't write "name" attribute in HTML tags, I thought I could take with "id" attribute. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now