Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- The following record has been added to the database:<br>
- <br><?php echo $_POST["forename"]; ?><br>
- <br><?php echo $_POST["surname"]; ?><br>
- <br><?php echo $_POST["mobile"]; ?><br>
- <br><?php echo $_POST["homemobile"]; ?><br>
- <br><?php echo $_POST["email"]; ?><br>
- <br><?php echo $_POST["street"]; ?><br>
- <br><?php echo $_POST["town"]; ?><br>
- <br><?php echo $_POST["postcode"]; ?><br>
- <br><?php echo $_POST["country"]; ?><br>
- <br><?php echo $_POST["identifier"]; ?><br>
- <?php
- $servername = "63.223.86.80";
- $username = "root";
- $password = "password";
- $dbname = "Contact App";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $sql = "INSERT INTO CONTACTS (Forename, Surname, Mobile, Home Mobile, E-mail, Street, Town, Post Code, Country, Group Identifier)
- VALUES (forename, surname, mobile, homemobile, email, street, town, postcode, country, identifier)";
- if (mysqli_query($conn, $sql)) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . mysqli_error($conn);
- }
- mysqli_close($conn);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement