I have a project in Codeigniter that is in a folder within the domain. The folder structure is as follows:
/ domain / Web / project /
I'll call domain and project because of the client / site name
I can access the site in two ways: www.myspace.com/project or www.project.com .
However, in all% w_that I do, the variable forms
is empty when I fill in the www.projeto.com.br site (which should be correct because the client wants access as a site isolated from its root). If I fill out the forms from the site www.mydomain.com/project the variable $_POST
receives the data normally and I can proceed with the navigation.
Is there a way I can get the two URLs to receive the POST normally as one?
Here are the codes for $_POST
and controller, for a form
of login:
<form method="POST" action="sac/nova_conversa">
<input type="hidden" name="lojaID" id="lojaID" value="<?= @$lojaID; ?>" />
<p>
<label>Nome:</label>
<input type="text" name="nome" id="nome" />
</p>
<p>
<label>Telefone:</label>
<input type="text" name="telefone" id="telefone" />
</p>
<p>
<label>E-mail:</label>
<input type="text" name="email" id="email" />
<input type="submit" value="Entrar" class="entrar" />
</p>
<?PHP if ($this->session->flashdata('errors')) { ?>
<p class="erro"><?= $this->session->flashdata('errors'); ?></p>
<?PHP } ?>
</form>
Controller:
public function nova_conversa() {
if ($_POST) {
$data["nome"] = $this->input->post("nome");
$data["telefone"] = $this->input->post("telefone");
$data["email"] = $this->input->post("email");
if (($data["nome"] == "") or ($data["telefone"] == "") or ($data["email"] == "")) {
$this->session->set_flashdata('errors', 'Digite seus dados');
redirect("sac");
} else {
$usuarioID = $this->sac_model->novo_usuario($data);
$data["lojaID"] = $this->input->post("lojaID");
$conversaID = $this->sac_model->nova_conversa($usuarioID, $data["lojaID"]);
$this->session->set_userdata('chat_usuarioID', $usuarioID);
$this->session->set_userdata('conversaID', $conversaID);
redirect("sac/abrir_conversa");
}
}
}
Thank you!