chosensiren Posted June 18, 2013 Share Posted June 18, 2013 <?php //connect to the database require_once('connectvars.php'); $firstname = ( $_POST['firstname']); $lastname = ( $_POST['lastname']); $username = ( $_POST['username']); $password = ( $_POST['password1']); $email = ( $_POST['email']); //insert data into table $query = "INSERT INTO summerfun_users (username, password, email, first_name, last_name) VALUES ($username, '$password', '$email', '$firstname', '$lastname')"; mysqli_query($dbc, $query); //confirm success with the user echo "congrats friend, you are now a member of summer fun"; ?> i am getting undefined index errors on all my variables, please help Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 18, 2013 Share Posted June 18, 2013 So - show us the code that comprises the web page itself. I'm guessing you have no <input> tags with "name='firstname' " or "name='lastname' ", etc. That or the fields are not within the <form>... </form> tags. Or you are using a "method='GET' " in your form. Quote Link to comment Share on other sites More sharing options...
Q695 Posted June 18, 2013 Share Posted June 18, 2013 http://php.net/manual/en/function.print-r.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.