Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db_host ="";//Valid data
- $db_username ="";//Valid data
- $db_pass ="";//Valid data
- $db_name ="";//Valid data
- $dbcon = mysql_connect("$db_host","$db_username","$db_pass") or die ("Could not connect to MySQL.");
- @mysql_select_db("$db_name") or die ("No database");
- $userID = htmlentities($_GET["userID"]);
- $firstName = htmlentities($_GET["firstName"]);
- $lastName = htmlentities($_GET["lastName"]);
- $address1 = htmlentities($_GET["address1"]);
- $city = htmlentities($_GET["city"]);
- $state = htmlentities($_GET["state"]);
- $zip = htmlentities($_GET["zip"]);
- $sqlinsert = "INSERT INTO `Customers` (`UserID`, `FirstName`, `LastName`, `Address1`, `City`, `State`, `Zip`) VALUES ('$userID', '$firstName', '$lastName', '$address1', '$city', '$state', '$zip')";
- if(!mysqli_query($dbcon, $sqlinsert)){
- die('error inserting new record! )');
- }//end of nested if statement
- $newrecord = "1 record added to the database";
- ?>
- <html>
- <body style="background-color: #FFFFDD;">
- <?php echo $newrecord; ?><br />
- This is the Account you entered:<br />
- This is the User ID: <?php echo $userID ?> <br />
- This is the First Name <?php echo $firstName; ?><br />
- This is the Last Name <?php echo $lastName; ?><br />
- This is the Address <?php echo $address1; ?> <br />
- This is the City <?php echo $city; ?> <br />
- This is the State<?php echo $state; ?> <br />
- This is the Zip code <?php echo $zip; ?> <br />
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement