Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="">
- <meta name="keywords" content="">
- <meta name="generator" content="Responsive Site Designer 1.5.1419">
- <title>Share to teach</title>
- <link rel="stylesheet" href="css/coffeegrinder.min.css">
- <link rel="stylesheet" href="css/wireframe-theme.min.css">
- <script>document.createElement( "picture" );</script>
- <script src="js/picturefill.min.js" class="picturefill" async="async"></script>
- <link rel="stylesheet" href="css/main.css">
- </head>
- <?php
- $name = $_POST["myname"];
- $surname = $_POST["mysurname"];
- $email = $_POST["myemail"];
- $username = $_POST["myusername"];
- $password = $_POST["pass1"];
- $country = $_POST["mycountry"];
- //On the line below, there is a mistake with an open bracket (
- //Remove it
- $city = ($_POST["mycity"];
- $type = $_POST["mytype"];
- $school = $_POST["myschool"];
- print($name);
- require_once("dd.php");
- //Now that config.php is part of this file. It will suffice to use $db as the connection variable
- // or you can still assing $conn = $db and work
- //In case you decided to use $connection = mysqli_connect(...)
- ///Then you can check here with $connection
- if (!$conn) {
- die('Connect Error: ' . mysqli_connect_error());
- }
- //In your insert statement here. You are not suppose to have double quates around variables.
- // That is where you have values. they are suppose to be single quotes
- //Inserting double quotes fits those values as strings. and not their content
- mysqli_query($conn,"INSERT INTO `users`( `user_name`, `password`, `first_name`, `last_name`, `school`, `email`, `country`, `city`)
- VALUES ('"$username"','"$password"','"$name"','"$surname"','"$school"','"$email"','"$country"','"$city"')");
- /*
- Try any of these two options
- $query = mysqli_query("INSERT INTO `users` (`user_name`, `password`, `first_name`, `last_name`, `school`, `email`, `country`, `city`)
- VALUES ('$username', '$password', '$name', '$surname', '$school', '$email', '$country', '$city');
- $result = mysqli_query($conn, $query);
- //Or you can still use this
- mysqli_query($conn, "INSERT INTO `users` (`user_name`, `password`, `first_name`, `last_name`, `school`, `email`, `country`, `city`)
- VALUES ('$username', '$password', '$name', '$surname', '$school', '$email', '$country', '$city');
- */
- mysqli_close($conn);
- ?>
- <html>
- <form align="left" name="form1" method="onload" action="index.html">
- </html>
- <script>
- alert("The form was submitted");
- </script>
- <div id='fg_membersite_content'>
- <h2>Follow link to log in</h2>
- <ul>
- <li><a href='login.php'>Login</a></li>
- </ul>
- </div>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement