Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!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">
- <head>
- <?php
- $conexao = mysql_connect('localhost', 'root', '3630207')
- or die('Erro ao conectar com o bando de dados!');
- $db = mysql_select_db('informacoes')
- or die('Erro ao selecionar o banco de dados!');
- ?>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Cadastro de contas</title>
- </head>
- <body>
- <h1><strong>CADASTRO DE USUÁRIOS</strong></h1>
- <form name="cadastrar" action="" method="post" enctype="multipart/form-data">
- <h3>Usuário:
- <input name="usuario" type="text" value="Usuario" />
- </h3>
- <h3>
- Senha:
- <input name="senha" type="password" />
- </h3>
- <h3>
- Score:
- <input name="score" type="text" value="Score" />
- </h3>
- <h3>Dinheiro:
- <input name="dinheiro" type="text" value="Dinheiro" />
- </h3>
- <h3>
- Avisos:
- <input name="avisos" type="text" value="Avisos" />
- </h3>
- <h3>
- Nivel:
- <input name="nivel" type="text" value="Nivel" />
- </h3>
- <h3>
- Vip:
- <input name="vip" type="text" value="Vip" />
- </h3>
- <h3>
- Skin:
- <input name="skin" type="text" value="Skin" />
- </h3>
- <h3>
- Admin:
- <input name="admin" type="text" value="Admin" />
- </h3>
- <h3>
- <input type="submit" name="cadastrar" value="Cadastrar"/>
- </h3>
- </form>
- <form action="index.php">
- <input type="submit" name="voltar" value="Voltar"/>
- </form>
- <?php if(isset($_POST['cadastrar']))
- {
- $usuario = $_POST['usuario'];
- $senha = $_POST['senha'];
- $score = $_POST['score'];
- $dinheiro = $_POST['dinheiro'];
- $avisos = $_POST['avisos'];
- $nivel = $_POST['nivel'];
- $vip = $_POST['vip'];
- $skin = $_POST['skin'];
- $admin = $_POST['admin'];
- if($usuario == ''){
- echo 'Campo usuário está em branco! Preencha!';
- }else if($senha == ''){
- echo 'Campo senha está em branco! Preencha!';
- }else if($score == ''){
- echo 'Campo score está em branco! Preencha!';
- }else if($dinheiro == ''){
- echo 'Campo dinheiro está em branco! Preencha!';
- }else if($avisos == ''){
- echo 'Campo avisos está em branco! Preencha!';
- }else if($nivel == ''){
- echo 'Campo nivel está em branco! Preencha!';
- }else if($vip == ''){
- echo 'Campo vip está em branco! Preencha!';
- }else if($skin == ''){
- echo 'Campo skin está em branco! Preencha!';
- }else if($admin == ''){
- echo 'Campo score está em branco! Preencha!';
- }else{
- $inserir = mysql_query("INSERT INTO informacoes (usuario, senha, score, dinheiro, avisos, nivel, vip, skin, admin) VALUES ('$usuario', '$senha', '$score', '$dinheiro', '$avisos', '$nivel', '$vip', '$skin', '$admin')");
- if($inserir == '')
- {
- echo 'Erro ao cadastrar usuário!';
- }
- else
- {
- echo 'Cadastro efetuado com sucesso!';
- }
- } // fechando else
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement