Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "test";
- $Name = $_POST['Name'];
- $Username = $_POST['Username'];
- $Password = $_POST['Password'];
- $Email = $_POST['Email'];
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- header("Location:#");
- }
- //Inserting Data
- try{
- $sql = "INSERT INTO User (uName , uUsername , uPassword , uEmail) VALUES ('$Name' , '$Username' , '$Password' , '$Email')";
- mysql_query($conn, $sql);
- }catch (Exception $e) {
- echo 'Caught exception: ', $e->getMessage(), "n";
- }
- $conn->close();
- header("Location:#");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement