Jump to content

SOLVED - Custom controller doesn't retrieve data


Recommended Posts

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 by felix7 (see edit history)
Link to comment
Share on other sites

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 by felix7 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...