0
I am having a big problem in receiving and sending the data to the database because, when creating a system where there is the possibility of using the physical person or legal person, they send to the same php page using the get mode I can show better how it looks (I always use the mothod post)..
localhost/php/action_cadastro.php?tipo=fisica&txtNome=elizandro+rafael+schmidt&txtEndereco=sanntos+dumont&txtBairro=lolo&txtCidade=louco&txtUf=SC&txtCep=02210-202&txtEmail=elizandro159%40gmail.com&txtTelefone=%2802%29+9390-3000&txtCelular=&txtRazaoSocial=&txtCnpj=&txtNomeFantasia=&txtEndereco2=&txtBairro2=&txtCidade2=&txtUf2=SC&txtCep2=&txtEmail2=&txtTelefone2=&txtFax2=&txtCelular2=&txtSite=&login=&senha=&senha2=
**
But the problem is that I don’t know how to create the condition where I can read the physical or legal type, I tried that way:
$tipo= $_post['tipo'];
if($tipo==="juridica"){ tantmatnantant
}else{
if($tipo==="fisica"){blablablablabla
}
but when storing in this way it goes null to the database, which is properly connected taking all the variables of physics. (detail used the same table to avoid bother on login)
$query = " INTO usuario (tipo,Nome,Endereco,Bairro,Cidade,Uf,Cep,Email,Telefone,Celular,Razao,Cnpj,Fantasia,Endereco2,Bairro2,Cidade2,Uf2,Cep2,Email2,Tel2,Fax2,Celular2,site,login,senha,data,hora)
VALUES ('$tipo','$Nome','$Endereco','$Bairro','$Cidade','$Uf','$Cep','$Email','$Telefone','$Celular','$Razao','$Cnpj','$Fantasia','$Endereco2','$Bairro2','$Cidade2','$Uf2','$Cep2','$Email2','$Tel2','$Fax2','$Celular2','$site','$login','$senha','$data','$hora')"or die ("1337");
$insert = mysql_query ($query,$conexao);
But use the POST method, and do the separation, if($_POST[person type]=physical) $tp = physical Else $tp = legal..
– Sr. André Baill
I always use the post method only to show I used get, but I will try friend, let’s see if it works. I already answer if I can.
– Elizandro Schmidt
Okay, no problem, just let me know.
– Sr. André Baill
It didn’t work buddy... @.@ (I can’t touch which bug @.@ )kkk
– Elizandro Schmidt
I left an answer that might solve your problem :)
– Paulo Weverton