Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
tenho um formulario feito em html e php que esta funcionando normalmente, fiz um template e passei o formulario pra esse template, agora o cadastro nao funciona mais, aqui esta o formulario
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="../css/style.css"/>
<title>Untitled Document</title>
<script type="text/javascript" src="../jscripts/jsgeral.js">
</script>
</head>
<body >
<div id="geral">
<div id="topo">
<img src="../images/topo.jpg"/>
</div><!--fim div topo-->
<div id="menu">
<div id="menuformat">
<hr />
Cadastro de:
<div id="quebramenu"><a href="cadastra_tecnicos.html"><img src="../buttons/tecnicos.png"/></a></div>
<div id="quebramenu"><a href="cadastra_clientes.html"><img src="../buttons/clientes.png"/></a></div>
<div id="quebramenu"><a href="cadastra_equipamentos.html"><img src="../buttons/equipamentos.png" /></a></div>
</div>
<div id="menuformat">
<hr />
Consultas de:
<div id="quebramenu"><a href="consulta_tecnicos.html"><img src="../buttons/tecnicos.png"/></a></div>
<div id="quebramenu"><a href="consulta_clientes.html"><img src="../buttons/clientes.png"/></a></div>
<div id="quebramenu"><a href="consulta_equipamentos.htmç"><img src="../buttons/equipamentos.png" /></a></div>
</div>
<div id="menuformat">
<hr />
Chamados:
<div id="quebramenu"><a href="abre_chamados.html"><img src="../buttons/abertura.png"/></a></div>
<div id="quebramenu"><a href="fecha_chamados.html"><img src="../buttons/encerramento.png"/></a></div>
<div id="quebramenu"><a href="consulta_chamados.html"><img src="../buttons/consultas.png" /></a></div>
</div>
</div><!--fim div menu-->
<div id="conteudo">
<form name="form_cadastro_tecnicos" method="post" action="../php/trata_cadastro_tecnico.php" >
<table>
<tr>
<td>Nome:</td><td><input type="text" name="nome" maxlength="50" size="50"/></td>
</tr>
<tr>
<td>Endereço:</td><td><input type="text" name="endereco" maxlength="100" size="50"/></td>
</tr>
<tr>
<td>Bairro:</td><td><input type="text" name="bairro" maxlength="50" size="50"/></td>
</tr>
<tr>
<td>Cidade:</td><td><input type="text" name="cidade" maxlength="50" size="20"/>Estado:
<select name="estado">
<option>RS</option>
<option>SC</option>
<option>PR</option>
<option>MT</option>
<option>MS</option>
<option>GO</option>
<option>DF</option>
</select>
</td>
</tr>
<tr>
<td>Fone Residencial:</td><td><input type="text" onKeyPress="mascarafone(this);" name="fone_residencial" maxlength="13" size="16"/>Fone Celular:<input type="text" onkeypress="mascarafone(this);" name="fone_celular" maxlength="13" size="16"/></td>
</tr>
<tr>
<td>E-mail:</td><td><input type="text" name="email" maxlength="50" size="50"/></td>
</tr>
<tr>
<td>Msn:</td><td><input type="text" name="msn" maxlength="50" size="50"/></td>
</tr>
<tr>
<td>RG:</td><td><input type="text" name="rg" maxlength="20" size="20"/>CPF:<input type="text" name="cpf" onkeypress="mascaracpf(this);"maxlength="14" size="20"/></td>
</tr>
<tr>
<td>CRVA:</td><td><input type="text" name="crva" maxlength="11" size="20"/></td>
</tr>
<tr>
<td>Login:</td>
<td><input type="text" name="login" maxlength="50" size="50"/></td>
</tr>
<tr>
<td>Senha:</td>
<td><input type="password" name="senha" maxlength="50" size="20"/></td>
</tr>
<tr>
<td>Confirmar senha:</td>
<td><input type="password" name="senhateste" maxlength="50" size="20"/></td>
</tr>
</table>
<table>
<tr>
<td>Nivel de Usuário:</td>
</tr>
<tr>
<td><label for="tec">Técnico </label></td><td><input type="radio" id="tec" name="nivel_usuario" checked="checked" value="tecnico"/></td><td><label for="assce">Assessor</label></td><td><input type="radio" id="assce" name="nivel_usuario" value="assessor"/></td>
</tr>
<tr>
<td><label for="cord">Cordenador </label></td><td><input type="radio" id="cord" name="nivel_usuario" value="cordenador"/></td><td><label for="ger">Gerente </label></td><td><input type="radio" id="ger" name="nivel_usuario" value="gerente"/></td>
</tr>
<tr>
<td><label for="adm">Administrativo </label></td><td><input type="radio" id="adm" name="nivel_usuario" value="administrativo"/></td><td><label for="out">Outros </label></td><td><input type="radio" id="out" name="nivel_usuario" value="outros"/></td>
</tr>
</table>
<table>
<tr>
<td><input type="submit" onclick="return verificatecnicos();" value="Confirmar Cadastro"/></td>
<td><input type="reset" value="Limpar Campos"/></td>
</table>
</form>
</div><!--fim div conteudo-->
<div id="rodape">
<p class="rodape">XXXXXXXXXXXXXXXXXXXXXX</p>
<p class="rodape">XXXXXXXXXXXXXX</p>
<p class="rodape">Telefone 51-XXXX XXXX</p>
</div><!--fim div rodape-->
</div>
</body>
</html><?php
include'includes/conecta.php';
$nome=htmlspecialchars(trim($_POST['nome']));
$endereco=htmlspecialchars(trim($_POST['endereco']));
$bairro=htmlspecialchars(trim($_POST['bairro']));
$cidade=htmlspecialchars(trim($_POST['cidade']));
$fone_residencial=htmlspecialchars(trim($_POST['fone_residencial']));
$fone_celular=htmlspecialchars(trim($_POST['fone_celular']));
$email=htmlspecialchars(trim($_POST['email']));
$msn=htmlspecialchars(trim($_POST['msn']));
$rg=htmlspecialchars(trim($_POST['rg']));
$cpf=htmlspecialchars(trim($_POST['cpf']));
$crva=htmlspecialchars(trim($_POST['crva']));
$nivel_usuario=htmlspecialchars(trim($_POST['nivel_usuario']));
$estado=htmlspecialchars(trim($_POST['estado']));
$login=htmlspecialchars(trim($_POST['login']));
$senha=htmlspecialchars(trim($_POST['senha']));
$senhateste=htmlspecialchars(trim($_POST['senhateste']));
$teste_login=mysql_num_rows(mysql_query("select login from cadastro_tecnicos where login='$login'"));
$teste_rg=mysql_num_rows(mysql_query("select rg from cadastro_tecnicos where rg='$rg'"));
$teste_cpf=mysql_num_rows(mysql_query("select cpf from cadastro_tecnicos where cpf='$cpf'"));
$teste_crva=mysql_num_rows(mysql_query("select crva from cadastro_tecnicos where crva='$crva'"));
if($teste_login==0 && $teste_rg==0 && $teste_cpf==0 && teste_crva==0){
$insere = "INSERT INTO cadastro_tecnicos (nome, endereco, bairro, cidade, fone_residencial, fone_celular, email, msn, rg, cpf, crva, nivel_usuario, estado, login, senha) VALUES ('$nome','$endereco','$bairro','$cidade','$fone_residencial','$fone_celular', '$email', '$msn', '$rg', '$cpf', '$crva', '$nivel_usuario', '$estado', '$login', '$senha')";
$inserir=mysql_query($insere) or die (mysql_error('falha no cadastro.') );
echo("Cadastro efetuado com sucesso.");
}
?>
aqui esta o arquivo que abre a conexão
<?php
$host='localhost';
$user='root';
$senha='';
$banco='espec_open';
$conexao=mysql_connect($host,$user,$senha) or die (mysql_error());
mysql_select_db($banco);
?>
se eu abro o original ele continua funcionando, quando passei pro template ele simplesmente parou, cuidei os links pois o template ja esta na estrutura de pastas final, alguem pode me dar uma luz sobre isso?
Carregando comentários...