msinformatica
(usa Outra)
Enviado em 03/08/2009 - 17:20h
Amigos, por favor , podem me ajudar ?
Eu criei um banco com nome prazo dei as devidas permissões e estou tentando inserir os dados de um form em html no banco mas não insere nada.
FORM HTML.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> UUUUUU </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="635" border="0" align="center">
<tr>
<td colspan="2"><div align="center"><font color="#666666" size="7"><img src="Imagens/Logo.jpg" width="681" height="187"></font></div></td>
</tr>
<tr>
<td height="65" colspan="2"><div align="center"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><img src="Imagens/cadprazo.png" width="250" height="24"></font></div></td>
</tr>
<tr>
<td>Código</td>
<td><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="id" type="text" id="id" size="11">
</font></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="19%"><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Número
processo</font></div></td>
<td width="81%"><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="processo" type="text" value="" size="25">
</font></div></td>
</tr>
<tr>
<td colspan="2"><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"></font></div></td>
</tr>
<tr>
<td><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Requerente</font></div></td>
<td><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="requerente" type="text" id="requerente" size="60">
</font></div></td>
</tr>
<tr>
<td colspan="2"><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"></font></div></td>
</tr>
<tr>
<td><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Requerido</font></div></td>
<td><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="requerido" type="text" id="requerido" size="60">
</font></div></td>
</tr>
<tr>
<td colspan="2"><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"></font></div></td>
</tr>
<tr>
<td><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Ação</font></div></td>
<td><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="feito" type="text" id="requerente3" size="80">
</font></div></td>
</tr>
<tr>
<td colspan="2"><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"></font></div></td>
</tr>
<tr>
<td><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Data
Publicação</font></div></td>
<td><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="dpubli" type="text" id="Feito" size="20">
</font></div></td>
</tr>
<tr>
<td colspan="2"><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"></font></div></td>
</tr>
<tr>
<td><div align="left"><font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Prazo</font></div></td>
<td><div align="left"><font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="dprazo" type="text" id="dpubli" size="20">
</font></div></td>
</tr>
<tr>
<td colspan="2"><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"></font></div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<form name="form1" method="post" action="inclusao.php">
<input type="submit" name="cadastro" value="Cadastrar">
</form>
<a href="index.htm" target="_parent"><img src="Imagens/3.jpg" alt="Voltar" width="27" height="24" border="0"></a></div></td>
</tr>
</table>
</body>
</html>
INCLUSAO.PHP
<html>
<head>
<title>Documento sem título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
// RECEBENDO OS DADOS PREENCHIDOS DO FORMULÁRIO !
$id = $_POST ['id'];
$processo = $_POST ['processo'];
$requerente = $_POST ['requerente'];
$requerido = $_POST ['requerido'];
$feito = $_POST ['feito'];
$dpubli = $_POST ['dpublic'];
$dprazo = $_POST ['dprazo'];
$host = "localhost"; //computador onde o servidor de banco de dados esta instalado
$user = "root"; //seu usuario para acessar o banco
$pass = "ms_160376"; //senha do usuario para acessar o banco
$banco = "prazo"; //banco que deseja acessar
$conexao = mysql_connect($host, $user, $pass) or die (mysql_error());
mysql_select_db($banco);
$query = 'INSERT INTO prazo VALUES ("'.$id.'", "'.$processo.'", "'.$requerente.'", "'.$requerido.'", "'.$feito.'", "'.$dpubli.'", "'.$dprazo.'"';
mysql_query($query,$conexao);
echo "<body onload=\"document.location.href='ok.htm'\">";
?>
</body>
</html>