0
opa ! I am learning to use the trio html+php+mysql and the business is giving me a ball. when I finally managed to understand the mistakes I was making, I went to the most real test, I made a very simple login registration, the strange, only sends the password field to the bank the login and the email simply won’t. the codes: cadastro_login.html
<DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<title> Cadastro de Usuário </title>
</head>
<body>
<form method="POST" action="cadastro_login.php">
<label>Nome</label>
<br>
<input type="text" name="usuario" >
<br>
<br>
<label>Senha:</label>
<br>
<input type="password" name="senha" >
<br>
<br>
<label>e-mail:</label>
<br>
<input type="text" name="email" >
<br>
<br>
<input type="submit" value="Cadastrar" name="cadastrar">
</form>
<br>
<br>
<button type="button" onclick="index.html"> Início</button>
</body>
</html>
php.
<?php
include_once ('conexao1.php');
$usuario = $_POST['usuario'];
$senha = $_POST['senha'];
$email = $_POST['email'];
$query= "INSERT INTO USUARIOS(usuario, senha, email)
VALUES('$usuario','$senha','$email')";
mysqli_query($db, $query);
?>
connection1.php
<?php
$host = "localhost";
$user = "root";
$password = "";
//$database ="teste";
// Create connection
$db = mysqli_connect($host, $user, $password) or die ('Não foi possivel conectar ao servidor');
mysqli_select_db($db, 'testa' ) or die(mysqli_error($db));
echo "conectado";
?>
Thanks for the tips ! I will analyze calmly ...
– juliano
the strange thing is that after I restarted it worked normal ... at first I’ll leave as it is, as I’m not a programmer and I won’t be, I’m only doing it because I’ve tried 3 people and the three said they would and never spoke to me again, I’ll try to make it as simple as possible.
– juliano