Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. class DbHandler {
  2.  
  3. private $conn;
  4.  
  5. function __construct() {
  6. require_once dirname(__FILE__) . '/DbConnect.php';
  7. // opening db connection
  8. $db = new DbConnect();
  9. $this->conn = $db->connect();
  10. }
  11. public function updateProfile($profile_picture, $username,$businessname, $town ) {
  12.  
  13.  
  14. $stmt = $this->conn->prepare("SELECT profile_information,username,businessname,town from profile_information WHERE phone = profile_id= ?");
  15. $stmt = $this->conn->prepare("UPDATE profile_information set profile_picture = ?, username= ?, businessname= ?, town= ? where profile_id= ?");
  16. $stmt->bind_param("ssssi",$profile_picture, $username, $businessname, $town,$profile_id);
  17. $stmt->execute();
  18. $stmt->close();
  19. }
  20.  
  21. }
  22.  
  23. include './DbHandler.php';
  24. $db = new DbHandler();
  25. if ( isset($_POST['profile_picture']) && isset($_POST['username']) && isset($_POST['businessname']) && isset($_POST['town'])!= '') {
  26.  
  27. $profile_picture = $_POST['profile_picture'];
  28. $username = $_POST['username'];
  29. $businessname = $_POST['businessname'];
  30. $town = $_POST['town'];
  31.  
  32. $response = $db->updateProfile( $profile_picture, $username, $businessname, $town);
  33. }
  34. ?>
  35.  
  36. <!doctype html>
  37. <html lang="en"
  38. <body>
  39. <form name="uploadForm" method="post" action="update_profile.php" >
  40. <label>profilep</label> <input type="text" name="profile_picture" > <br><br>
  41. <label>Uname</label> <input type="text" name="username" > <br> <br>
  42. <label>BName</label> <input type="text" name="businessname" > <br><br>
  43. <label>Town </label> <input type="text" name="town" > <br><br>
  44. <input type="submit" name="submit" value="Submit" />
  45. </form>
  46. </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement