php - Registration information for user not being saved into database in phpmyadmin -
i'm using below tutorial , have read thru , searched multiple questions without luck solving this.
https://www.youtube.com/watchv=e8tp2ferkls&index=39&list=pl0eyrzgxdwhwbtoawjm9faf1ixepexft-
i've checked small syntax errors missing quotes, semicolons, etc , haven't found errors.
i've confirmed variables echo properly. it's last step of saving information in database on phpmyadmin. i'm using xampp.
tried solve hours. i'd appreciate feedback.
index.php (i copied , pasted form not post entire front-end code).
<form action="signup.php" method="post"> <input type="text" name="name" placeholder="first , last name"> <input type="text" name="email" placeholder="email address"> <input type="text" name="mobilephone" placeholder="mobile phone number"> <input type="password" name="pwd" placeholder="password"> <input type="password" name="pwd2" placeholder="repeat password"> <input type="text" name="haddress" placeholder="home address"> <input type="text" name="eaddress" placeholder="employer address"> <input type="text" name="vyear" placeholder="vehicle year"> <input type="text" name="vmake" placeholder="vehicle make"> <input type="text" name="vmodel" placeholder="vehicle model"> <br/> <button type="submit">sign up!</button> </form>
signup.php
<?php include 'dbh.php'; $name = $_post['name']; $email = $_post['email']; $mobilephone = $_post['mobilephone']; $pwd = $_post['pwd']; $pwd2 = $_post['pwd2']; $haddress = $_post['haddress']; $eaddress = $_post['eaddress']; $vyear = $_post['vyear']; $vmake = $_post['vmake']; $vmodel = $_post['vmodel']; $sql = "insert customer (name, email, mobilephone, pwd, pwd2, haddress, eaddress, vyear, vmake, vmodel) values ('$name', '$email', '$mobilephone', '$pwd', '$pwd2', '$haddress', '$eaddress', '$vyear', '$vmake', '$vmodel',)"; $result = mysqli_query($conn, $sql); header("loctaion: index.php"); ?>
dbh.php
<?php $conn = mysqli_connect("localhost", "root", "", "oilbizsignup"); if (!$conn) { die("connection failed: ".mysqli_connect_error()); /* tells error message if fail connection*/ } ?>
Comments
Post a Comment