Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DbHandler {
- private $conn;
- function __construct() {
- require_once dirname(__FILE__) . '/DbConnect.php';
- // opening db connection
- $db = new DbConnect();
- $this->conn = $db->connect();
- }
- public function updateProfile($profile_picture, $username,$businessname, $town ) {
- $stmt = $this->conn->prepare("SELECT profile_information,username,businessname,town from profile_information WHERE phone = profile_id= ?");
- $stmt = $this->conn->prepare("UPDATE profile_information set profile_picture = ?, username= ?, businessname= ?, town= ? where profile_id= ?");
- $stmt->bind_param("ssssi",$profile_picture, $username, $businessname, $town,$profile_id);
- $stmt->execute();
- $stmt->close();
- }
- }
- include './DbHandler.php';
- $db = new DbHandler();
- if ( isset($_POST['profile_picture']) && isset($_POST['username']) && isset($_POST['businessname']) && isset($_POST['town'])!= '') {
- $profile_picture = $_POST['profile_picture'];
- $username = $_POST['username'];
- $businessname = $_POST['businessname'];
- $town = $_POST['town'];
- $response = $db->updateProfile( $profile_picture, $username, $businessname, $town);
- }
- ?>
- <!doctype html>
- <html lang="en"
- <body>
- <form name="uploadForm" method="post" action="update_profile.php" >
- <label>profilep</label> <input type="text" name="profile_picture" > <br><br>
- <label>Uname</label> <input type="text" name="username" > <br> <br>
- <label>BName</label> <input type="text" name="businessname" > <br><br>
- <label>Town </label> <input type="text" name="town" > <br><br>
- <input type="submit" name="submit" value="Submit" />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement