1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
| <?php
$id = "";
$image = $file;
$titre= htmlspecialchars($_POST["titre"]);
$createur= htmlspecialchars($_POST["createur"]);
$datecrea= htmlspecialchars($_POST["datecrea"]);
$description= htmlspecialchars($_POST["description"]);
$prix= htmlspecialchars($_POST["prix"]);
$datepromo= htmlspecialchars($_POST["datepromo"]);
$nbjeton= htmlspecialchars($_POST["nbjeton"]);
$smartcontract= htmlspecialchars($_POST["smartcontract"]);
$collection= htmlspecialchars($_POST['collection']);
$echange= htmlspecialchars($_POST["echange"]);
$echangedescription= htmlspecialchars($_POST["echangedescription"]);
$royalties= htmlspecialchars($_POST["royalties"]);
$instagram= htmlspecialchars($_POST["instagram"]);
$twitter= htmlspecialchars($_POST["twitter"]);
$tiktok= htmlspecialchars($_POST["tiktok"]);
$urlopensea= htmlspecialchars($_POST["urlopensea"]);
$ip = $_SERVER['REMOTE_ADDR'];
$certif =0;
$serveur = "localhost";
$dbname = "nomdematable";
$user = "pensesachangerici";
$pass = "heureusementjaichangerici";
try{
$dbco = new PDO("mysql:host=$serveur;dbname=$dbname",$user,$pass);
$dbco->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//On insère les données reçues
$sth = $dbco->prepare("
INSERT INTO nft(id, titre, description, image, createur, datecrea, datepromo, prix, nbjeton, smartcontract, collection, echangedescription, royalties, urlopensea, echange, instagram, twitter, tiktok, certif, ip)
VALUES(:id, :titre, :description, :image, :createur, :datecrea, :datepromo, :prix, :nbjeton, :smartcontract, :collection, :echangedescription, :royalties, :urlopensea, :echange, :instagram, :twitter, :tiktok, :certif, :ip)");
$sth->bindParam(':id',$id);
$sth->bindParam(':titre',$titre);
$sth->bindParam(':description',$description);
$sth->bindParam(':image',$image);
$sth->bindParam(':createur',$createur);
$sth->bindParam(':datecrea',$datecrea);
$sth->bindParam(':datepromo',$datepromo);
$sth->bindParam(':prix',$prix);
$sth->bindParam(':nbjeton',$nbjeton);
$sth->bindParam(':smartcontract',$smartcontract);
$sth->bindParam(':collection',$collection);
$sth->bindParam(':echangedescription',$echangedescription);
$sth->bindParam(':royalties',$royalties);
$sth->bindParam(':urlopensea',$urlopensea);
$sth->bindParam(':echange',$echange);
$sth->bindParam(':instagram',$instagram);
$sth->bindParam(':twitter',$twitter);
$sth->bindParam(':tiktok',$tiktok);
$sth->bindParam(':certif',$certif);
$sth->bindParam(':ip',$ip);
$sth->execute();
//On renvoie l'utilisateur vers la page de remerciement
// header("Location:form-merci.html");
}
catch(PDOException $e){
// echo 'Impossible de traiter les données. Erreur : '.$e->getMessage();
}
?> |
Partager