Ir para conteúdo
Fórum Script Brasil

Elnegritocomar

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

Tudo que Elnegritocomar postou

  1. Galera, boa tarde, sou novo no fórum e estou fazendo um cadastro de usuários, e não consigo enviar ao banco os dados, peço por favor a ajuda de vocês, deve ser alguma bobagem que não estou enxergando, desde já agradeço a todos. Segue o código de cadastro e logo a página cadastrando que insere os valores no banco mysql no final ponho o banco: <html> <head> <title>Sistema de cadastro</title> </head> <body> <form name="signup" method="post" action"cadastrando.php"> Nome: <br /> <input type = "text" name = "nome" /><br /><br /> Sobrenome: <br /> <input type = "text" name = "sobrenome" /><br /><br /> País: <br /> <input type = "text" name = "pais" /><br /><br /> Estado: <br /> <input type = "text" name = "estado" /><br /><br /> Cidade: <br /> <input type = "text" name = "cidade" /><br /><br /> Email: <br /> <input type = "text" name = "email" /><br /><br /> Senha: <br /> <input type = "password" name = "senha" /><br /><br /> <input type = "submit" value = "Cadastrar" /> </form> </body> </html><?php $host = "localhost"; $user = "root"; $pass = "sanfernando117"; $banco = "cadastro"; $conexao = mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($banco) or die(mysql_error()); ?> <html> <head> <title>Cadastrando...</title> </head> <body> <?php $nome = $_POST ['nome']; $sobrenome = $_POST ['sobrenome']; $pais = $_POST ['pais']; $estado = $_POST ['estado']; $cidade = $_POST ['cidade']; $email = $_POST ['email']; $senha = $_POST ['senha']; $sql= mysql_query("INSERT INTO usuarios (nome, sobrenome, pais, estado, cidade, email, senha) VALUES('$nome', '$sobrenome', '$pais', '$estado', '$cidade', '$email', '$senha')"); ?> </body> </html>CREATE DATABASE cadastro; create TABLE usuarios ( nome varchar(250) not null, sobrenome varchar(250) not null, pais varchar(250) not null, estado varchar(250) not null, cidade varchar(250) not null, email varchar(250) not null, senha varchar(250) not null, id int(11) unsigned not null auto_increment, primary key (id)); quando tento acessar à página cadastrando ela mostra esses erros: Notice: Undefined index: nome in C:\xampp\htdocs\cadastro\cadastrando.php on line 16 Notice: Undefined index: sobrenome in C:\xampp\htdocs\cadastro\cadastrando.php on line 17 Notice: Undefined index: pais in C:\xampp\htdocs\cadastro\cadastrando.php on line 18 Notice: Undefined index: estado in C:\xampp\htdocs\cadastro\cadastrando.php on line 19 Notice: Undefined index: cidade in C:\xampp\htdocs\cadastro\cadastrando.php on line 20 Notice: Undefined index: email in C:\xampp\htdocs\cadastro\cadastrando.php on line 21 Notice: Undefined index: senha in C:\xampp\htdocs\cadastro\cadastrando.php on line 22 Más $nome, $sobrenome......$senha están definidos, não vejo o erro, muito obrigado a todos
  2. Galera, boa tarde, sou novo no fórum e estou fazendo um cadastro de usuários, e não consigo enviar ao banco os dados, peço por favor a ajuda de vocês, deve ser alguma bobagem que não estou enxergando, desde já agradeço a todos. Segue o código de cadastro e logo a página cadastrando que insere os valores no banco mysql no final ponho o banco: <html> <head> <title>Sistema de cadastro</title> </head> <body> <form name="signup" method="post" action"cadastrando.php"> Nome: <br /> <input type = "text" name = "nome" /><br /><br /> Sobrenome: <br /> <input type = "text" name = "sobrenome" /><br /><br /> País: <br /> <input type = "text" name = "pais" /><br /><br /> Estado: <br /> <input type = "text" name = "estado" /><br /><br /> Cidade: <br /> <input type = "text" name = "cidade" /><br /><br /> Email: <br /> <input type = "text" name = "email" /><br /><br /> Senha: <br /> <input type = "password" name = "senha" /><br /><br /> <input type = "submit" value = "Cadastrar" /> </form> </body> </html> <?php $host = "localhost"; $user = "root"; $pass = "sanfernando117"; $banco = "cadastro"; $conexao = mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($banco) or die(mysql_error()); ?> <html> <head> <title>Cadastrando...</title> </head> <body> <?php $nome = $_POST ['nome']; $sobrenome = $_POST ['sobrenome']; $pais = $_POST ['pais']; $estado = $_POST ['estado']; $cidade = $_POST ['cidade']; $email = $_POST ['email']; $senha = $_POST ['senha']; $sql= mysql_query("INSERT INTO usuarios (nome, sobrenome, pais, estado, cidade, email, senha) VALUES('$nome', '$sobrenome', '$pais', '$estado', '$cidade', '$email', '$senha')"); ?> </body> </html> CREATE DATABASE cadastro; create TABLE usuarios ( nome varchar(250) not null, sobrenome varchar(250) not null, pais varchar(250) not null, estado varchar(250) not null, cidade varchar(250) not null, email varchar(250) not null, senha varchar(250) not null, id int(11) unsigned not null auto_increment, primary key (id)); quando tento acessar à página cadastrando ela mostra esses erros: Notice: Undefined index: nome in C:\xampp\htdocs\cadastro\cadastrando.php on line 16 Notice: Undefined index: sobrenome in C:\xampp\htdocs\cadastro\cadastrando.php on line 17 Notice: Undefined index: pais in C:\xampp\htdocs\cadastro\cadastrando.php on line 18 Notice: Undefined index: estado in C:\xampp\htdocs\cadastro\cadastrando.php on line 19 Notice: Undefined index: cidade in C:\xampp\htdocs\cadastro\cadastrando.php on line 20 Notice: Undefined index: email in C:\xampp\htdocs\cadastro\cadastrando.php on line 21 Notice: Undefined index: senha in C:\xampp\htdocs\cadastro\cadastrando.php on line 22 Más $nome, $sobrenome......$senha están definidos, não vejo o erro, muito obrigado a todos
×
×
  • Criar Novo...