Jump to content
Fórum Script Brasil
  • 0

Informações do script não são salvas no bd


fabricioje

Question

Pessoal, eu estou com uma dificuldade nesse script, as informações que eu coloco ele não estão sendo salvas no db, e também não esta mostrando nem um erro.

Alguém pode me ajudar?

index.html

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

</head>

<body>

<form name="form1" id="form1" method="post" action="validacao.php" />

<table width="387" border="0">

<tr>

<td width="163" align="right"><blockquote>usuario</blockquote></td>

<td width="208"><input type="text" name="usuario" id="usuario" /></td>

</tr>

<tr>

<td align="right"><blockquote>senha</blockquote></td>

<td><input type="text" name="senha" id="senha" /></td>

</tr>

<tr>

<td></td>

<td><input type="submit" name="cadastrar" id="cadastrar" value="Cadastrar"> </td>

</tr>

</table>

</body>

</html>

conexao.php

<?php

$con = mysql_connect("localhost","root","");

$bd = mysql_select_db("olimpiadas",$con);

?>

funcao_gravar.php

<?php

include "conexao.php";

$nome_equipe = $_POST['nome_equipe'];

$sql = mysql_query("INSERT INTO cadastro (nome_equipe) value('$nome_equipe')" or die (mysql_error());

header ("Location: olimpiadas.php");

?>

validacao.php

<?php

$usuario = $_POST['usuario'];

$login = $_POST['senha'];

if ($usuario == admin and $login == 123){

header ("Location: olimpiadas.html");}

if ($usuario <> admin and $login <> 123){

header ("Location: errado.php");}

?>

olimpiadas.html

<html>

<body>

<form name="equipe" id="equipe" method="post" action="olimpiadas.html">

<table width="300" height="0"border="0" align="center">

<tr>

<td>Digite o nome da sua equipe: <input type="text" name="nome_equipe" id="nome_equipe"></td>

<td><input type="submit" name="botao" id="botao" value="Cadastrar"></td>

</tr>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

</body>

</html>

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152k
    • Total Posts
      651.5k
×
×
  • Create New...