Hello, I manage to receive information about the localhost database but on the 000webhost database nothing happens… My code:
----------------------------------------------------------- PHP -------------------------------------------------------------
<?php
$bdd = new PDO('mysql:host=localhost;dbname=id9128652_cadenas', 'id9128652_projet', 'saucisse');
if(isset($_POST['forminscription']))
{
$pseudo = htmlspecialchars($_POST['pseudo']);
$mail = htmlspecialchars($_POST['mail']);
$mail2 = htmlspecialchars($_POST['mail2']);
$mdp = sha1($_POST['mdp']);
$mdp2 = sha1($_POST['mdp2']);
$insertmbr = $bdd->prepare("INSERT INTO membres(pseudo, mail, motdepasse) VALUES(?, ?, ?)");
$insertmbr->execute(array($pseudo, $mail, $mdp));
//$erreur = header('Location: inscription_check.php');
}
?>
-------------------------------------------------------- HTML ------------------------------------------------------------------
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="css/inscription.css" />
<link rel="icon" href="css/images/cadenas.ico" />
<title>Cadenas Connecté | Inscription</title>
</head>
<body>
<header> <!-- Entête -->
<div id="menu">
<img class="logo" src="css/images/cadenas.png">
<h2>- CADENAS CONNECTE -</h2>
<div id="nav">
<a href="accueil.php">ACCUEIL</a>
<a href="inscription.php">INSCRIPTION</a>
<a href="connexion.php">CONNEXION</a>
</div>
</div>
</header>
<h1>INSCRIPTION</h1>
<section class="contenu"> <!-- Contenu -->
<form method="POST" action=""><p class="contenu">
<label for="pseudo">Pseudo : <input type="text" placeholder="Inserez votre pseudo" id="pseudo" name="pseudo" value="<?php if(isset($pseudo)) { echo $pseudo; }?>" /></label><br/>
<label for="mail">Adresse e-mail : <input type="email" placeholder="Taper votre adresse-mail" id="mail" name="mail" value="<?php if(isset($mail)) { echo $mail; }?>"/></label><br/>
<label for="mail2">Confirmation de l'e-mail : <input type="email" placeholder="Retaper votre adresse-mail" id="mail2" name="mail2" value="<?php if(isset($mail2)) { echo $mail2; }?>"/></label><br/>
<label for="mdp">Mot de passe : <input type="password" placeholder="Inserez votre mot de passe" id="mdp" name="mdp"/></label><br/>
<label for="mdp2">Confirmation du mot de passe : <input type="password" placeholder="Retaper votre mot de passe" id="mdp2" name="mdp2"/></label><br/>
<input type="submit" name="forminscription" value="S'inscrire"/>
</p></form>
<?php
if(isset($erreur))
{
echo '<font color="red">' .$erreur."</font>";
}
?>
</section>
</body>
</html>