Advertisement
Guest User

displayCustomer

a guest
Apr 7th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. <?php
  2.  
  3. $db_host ="";//Valid data
  4. $db_username ="";//Valid data
  5. $db_pass ="";//Valid data
  6. $db_name ="";//Valid data
  7.  
  8. $dbcon = mysql_connect("$db_host","$db_username","$db_pass") or die ("Could not connect to MySQL.");
  9. @mysql_select_db("$db_name") or die ("No database");
  10.  
  11. $userID = htmlentities($_GET["userID"]);
  12. $firstName = htmlentities($_GET["firstName"]);
  13. $lastName = htmlentities($_GET["lastName"]);
  14. $address1 = htmlentities($_GET["address1"]);
  15. $city = htmlentities($_GET["city"]);
  16. $state = htmlentities($_GET["state"]);
  17. $zip = htmlentities($_GET["zip"]);
  18.  
  19. $sqlinsert = "INSERT INTO `Customers` (`UserID`, `FirstName`, `LastName`, `Address1`, `City`, `State`, `Zip`) VALUES ('$userID', '$firstName', '$lastName', '$address1', '$city', '$state', '$zip')";
  20.  
  21.     if(!mysqli_query($dbcon, $sqlinsert)){
  22.         die('error inserting new record! )');
  23.     }//end of nested if statement
  24.     $newrecord = "1 record added to the database";
  25.  
  26.  
  27.  
  28.  
  29. ?>
  30.  
  31. <html>
  32. <body style="background-color: #FFFFDD;">
  33.  
  34. <?php echo $newrecord; ?><br />
  35. This is the Account you entered:<br />
  36. This is the User ID: <?php echo $userID ?> <br />
  37. This is the First Name <?php echo $firstName; ?><br />
  38. This is the Last Name <?php echo $lastName; ?><br />
  39. This is the Address <?php echo $address1; ?> <br />
  40. This is the City <?php echo $city; ?> <br />
  41. This is the State<?php echo $state; ?> <br />
  42. This is the Zip code <?php echo $zip; ?> <br />
  43.  
  44.  
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement