Mexi em alguns itens no meu cadastro, aperto cadastrar e olha o que aparece:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'marco', 'marco', 'marco', 'v@', '19', '99999', 'marco', 'marco', 'marco', 'marco' at line 1 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'marco', 'marco', 'marco', 'v@', '19', '99999', 'marco', 'marco', 'marco', 'marco' at line 1 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'marco', 'marco', 'marco', 'v@', '19', '99999', 'marco', 'marco', 'marco', 'marco' at line 1You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'marco', 'marco', 'marco', 'v@', '19', '99999', 'marco', 'marco', 'marco', 'marco' at line 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]"> <html xmlns="[url="http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/url]"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <table width="650" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="224" height="140"> </td> <td width="252"> </td> <td width="174"> </td> </tr> <tr> <td height="24"> </td> <td valign="middle"> <font color="#FF0000"><b> <?php // inclui o arquivo de configuração do sistema include "Config/config_sistema.php"; // recebe dados do formulario $login = htmlspecialchars($_POST['login']); $senha = $_POST['senha']; $rep_senha = $_POST['rep_senha']; $razao_social = htmlspecialchars($_POST['razao_social']); $nome_responsavel = htmlspecialchars($_POST['nome_responsavel']); $cnpj = $_POST['cnpj']; $insc_est = $_POST['insc_est']; $email = htmlspecialchars($_POST['email']); $ddd = $_POST['ddd']; $telefone = $_POST['telefone']; $endereco = $_POST['endereco']; $referencia = $_POST['referencia']; $cidade = $_POST['cidade']; $cep = $_POST['cep']; $pergunta = htmlspecialchars($_POST['pergunta']); $resposta = htmlspecialchars($_POST['resposta']); // verifica se o usuario digitou o login if($login == "") { echo "Digite seu login!"; exit; } else { // se o usuario digitou o login ele verifica // se esta disponivel $consulta = mysql_query("select * from dados_usuarios where Login = '$login'"); $linha = mysql_num_rows($consulta); if($linha != 0) { echo "O nome de usuario que você<br> Digitou já existe tente outro!"; exit; } } // verifica se o usuario digitou a senha if($senha == "") { echo "Digite sua senha!"; exit; } else { // se o usuario digitou a senha // vamos comparar com a contra senha if($senha != $rep_senha) { echo "Senha invalida!"; exit; } } // verifica se o usuario digitou o nome if($razao_social == "") { echo "Digite a Razão Social!"; exit; } // verifica o email if($nome_responsavel == "") { echo "Digite o nome do responsável!"; exit; } // verifica o email if($cnpj == "") { echo "Digite o CNPJ!"; exit; } // verifica o email if($insc_est == "") { echo "Digite a Inscrição Estadual!"; exit; } // verifica o email if($ddd == "") { echo "Digite o DDD!"; exit; } // verifica o email if($telefone == "") { echo "Digite o Telefone!"; exit; } // verifica o email if($endereco == "") { echo "Digite o endereço!"; exit; } // verifica o email if($referencia == "") { echo "Digite a referência!"; exit; } // verifica a cidade if($cidade == "") { echo "Digite a cidade onde você mora!"; exit; } // verifica o cep if($cep == "") { echo "Digite o CEP de onde você mora!"; exit; } // verifica a pergunta secreta if($pergunta == "") { echo "Digite sua pergunta secreta!"; exit; } // verifica a resposta secreta if($resposta == "") { echo "Digite sua resposta secreta!"; exit; } // faz consulta no banco para inserir os dados do usuario $sql = ("INSERT INTO dados_usuarios (login, senha, razao_social, nome_responsavel, cnpj, insc_est, email, ddd, telefone, endereco, referencia, cidade, cep, pergunta, resposta) VALUES ('$login', '$senha', '$razao_social, '$nome_responsavel', '$cnpj', '$insc_est', '$email', '$ddd', '$telefone', '$endereco', '$referencia', '$cidade', '$cep', '$pergunta', '$resposta')"); $consulta = mysql_query($sql) or die(mysql_error()); // verifica se o usuario foi cadastrado if($consulta) { echo "<font color=green><b> Você foi cadastrado com sucesso!<br> Click <a href=index.php>aqui</a> para efetuar o login. </font></b>"; exit; } else { echo "Não foi possivel efetuar o seu cadastro<br> tente mais tarde pode ser um problema no servido!<br> Click <a href=index.php>aqui</a> para ir ate a home page do sistema."; exit; } ?> <!--DWLayoutEmptyCell--> </td> <td> </td> </tr> <tr> <td height="148"> </td> <td> </td> <td> </td> </tr> </table> </body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]"> <html xmlns="[url="http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/url]"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> form {font: 14px Trebuchet MS;} form input {font: 14px Trebuchet MS;} form #loginsenha { margin-bottom: 20px; background-color: #CCC; width: 680px; height: 80px; display: block;} form #loginsenha .txtform { float: left; text-align:right; width: 160px; margin-top: 2px; margin-right: 10px;} form #loginsenha .form input { height: 14px; border: 1px solid #666; background-color: #FFF;} form #loginsenha .form { float: right; text-align:left ; width: 500px; margin-top: 2px; margin-right: 10px;} form #dados { margin-bottom: 20px; background-color: #CCC; width: 680px; height: 100px; display: block;} form #dados .txtform { float: left; text-align:right; width: 160px; margin-top: 5px; margin-right: 10px;} form #dados .form input { height: 14px; border: 1px solid #666; background-color: #FFF;} form #dados .form { float: right; text-align:left ; width: 500px; margin-top: 5px; margin-right: 10px;} form #contato { margin-bottom: 20px; background-color: #CCC; width: 680px; height: 200px; display: block;} form #contato .txtform { float: left; text-align:right; width: 160px; margin-top: 5px; margin-right: 10px;} form #contato .form input#label8 {margin-right: 5px;} form #contato .form input { height: 14px; border: 1px solid #666; background-color: #FFF;} form #contato .form { float: right; text-align:left ; width: 500px; margin-top: 5px; margin-right: 10px;} </style> </head> <body> <form action="cadastra_usuario.php" method="post" enctype="multipart/form-data" name="formcadastro"> <span class="style1">Cadastro de usuarios </span> <h2>Insira os seus dados para que possamos efetuar o cadastro!</h2><br /> <h3>Todos os campos sao obrigatórios</h3> <div id="loginsenha"> <div class="txtform">Login:</div> <div class="form"><label for="textfield"></label> <input name="login" type="text" id="login" size="40" maxlength="200" /></div> <div class="txtform">Senha:</div> <div class="form"><label for="label"></label> <input name="senha" type="password" id="label" size="20" maxlength="15" /></div> <div class="txtform">Repetir senha:</div> <div class="form"><label for="label2"></label> <input name="rep_senha" type="password" id="label2" size="20" maxlength="15" /></div> </div><!-- /loginsenha --> <div id="dados"> <div class="txtform">Razão Social:</div> <div class="form"><label for="label3"></label> <input name="razao_social" type="text" id="label3" size="40" maxlength="200" /></div> <div class="txtform">Nome do responsável:</div> <div class="form"><label for="label4"></label> <input name="nome_responsavel" type="text" id="label4" size="40" maxlength="200" /></div> <div class="txtform">CNPJ:</div> <div class="form"><label for="label5"></label> <input name="cnpj" type="text" id="label5" size="40" maxlength="200" /></div> <div class="txtform">Inscrição Estadual:</div> <div class="form"><label for="label6"></label> <input name="insc_est" type="text" id="label6" size="40" maxlength="150" /></div> </div><!-- /dados --> <div id="contato"> <div class="txtform">E-mail:</div> <div class="form"><label for="label7"></label> <input name="email" type="text" id="label7" size="30" maxlength="150" /></div> <div class="txtform">Telefone com DDD:</div> <div class="form"> <label for="label8"></label><input name="ddd" type="text" id="label8" size="2" maxlength="2" /><label for="label9"></label><input name="telefone" type="text" id="label9" size="10" maxlength="8" /></div> <div class="txtform">Endereço completo:</div> <div class="form"><label for="label10"></label> <input name="endereco" type="text" id="label10" size="40" maxlength="200" /></div> <div class="txtform">Referência:</div> <div class="form"><label for="label11"></label> <input name="referencia" type="text" id="label11" size="40" maxlength="200" /></div> <div class="txtform">Cidade/UF:</div> <div class="form"><label for="label12"></label> <input name="cidade" type="text" id="label12" size="40" maxlength="50" /></div> <div class="txtform">CEP:</div> <div class="form"><label for="label13"></label> <input name="cep" type="text" id="label13" size="40" maxlength="8" /></div> <div class="txtform">Pergunta secreta:</div> <div class="form"><label for="label14"></label> <input name="pergunta" type="text" id="label14" size="40" maxlength="200" /></div> <div class="txtform">Resposta secreta:</div> <div class="form"><label for="label15"></label> <input name="resposta" type="text" id="label15" size="40" maxlength="200" /></div> </div><!-- /form --> <div class="form"> <label for="Submit"></label> <input type="submit" name="cadastrar" value="Cadastrar" id="cadastrar" /> <label for="label13"></label> <input type="reset" name="limpar" value="Limpar dados" id="label13" /> </form> </body> </html>