Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require
- ("conexao.php");
- ?>
- <!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>
- <meta http-equiv="Content-Type" content="text/html;meta-charset= charset=iso-8859-1" />
- <meta charset="utf8"/>
- <title>Cadastre-se</title>
- </head>
- <body>
- <form name="cadastro" method="post" action="cadastro/cadastro.php">
- Nome:
- <br>
- <input name="nome" type="text" id="nome" /><br />
- <br>
- Sobrenome
- <br>
- <input name="sobrenome" type="text" id="sobrenome" /><br />
- <br>
- Email
- <br>
- <input name="email" type="text" id="email" /><br />
- <br>
- Nome de Usuário
- <br>
- <input name="usuario" type="text" id="usuario" /><br />
- <br>
- Senha
- <br>
- <input name="senha" type="password" id="senha" /><br />
- <br>
- <input type="submit" name="Send" value="cadastrar" /> <br />
- </form>
- </body>
- </html>
- <?php
- //conexoes desponiveis para o mysqli
- $dbhost="localhost";
- $dbuser="root";
- $dbpass="";
- $dberror1="nao foi possivel si copnectar ao banco de dados";
- $dberror2="nao foi possivel encontrar a tabela de dados";
- $conn = mysqli_connect($dbhost,$dbuser,$dbpass) or die ($dberror1);
- $select_db = mysqli_select_db($conn,'cadastro')or die ($error2);
- ?>
- <?php
- require("../conexao.php");
- ?>
- <html>
- <head></head>
- <body>
- <?php
- $nome=$_POST['nome'];
- $sobrenome=$_POST['sobrenome'];
- $email=$_POST['email'];
- $usuario=$_POST['usuario'];
- $senha=$_POST['senha'];
- $sql=@mysqli_query("INSERT INTO utilizadores(nome,sobrenome,email,usuario,senha)
- values ('$nome','$sobrenome','$email','$usuario','$senha')");
- echo"cadastro efectuado com sucesso";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement