0
I’m learning to use POO
I would like to ask for help, as I cannot insert the $_POST
within a variable, I’ve researched and looked at my books, but I’m not getting any progress. I’m grateful for your help in learning this the right way.
<?php
if (isset($_POST['enviarFrech'])) {
$fech = $_POST['st'];
$data_atual = date("Y-m-d");
print_r($fech);
echo $data_atual;
class DadosMontagem {
public $lojamont;
public $monta;
public function set_lojamontador($l) {
$this->$lojamont = $l;
}
public function lsmt() {
echo $l;
}
}
$ls_mt = new DadosMontagem($_POST['lojamontar']);
$ls_mt->set_lojamontador();
$ls_mt->lsmt();
fechamentoMontador($conexao, $fech, $ls, $mt, $data_atual);
}
?>
I don’t understand the problem.
– rray
Apparently you are using it right, the question is if you are sending it correctly...to know that you need to post the form that is sending the data.
– Kenny Rafael
You are passing the form data as " method='post' "?
– Ursones
Yes. I’m sending via method='post' I did an echo before class and displayed the data correctly, but inside the class I do wrong, I’m still learning to use POO so I’m sure I made silly mistakes from a beginner.
– Danilo Araujo