diff --git a/assets/images/pp/5f9036058b40b2c23052d8226711ac5c.png b/assets/images/pp/5f9036058b40b2c23052d8226711ac5c.png new file mode 100644 index 00000000..7ec285db Binary files /dev/null and b/assets/images/pp/5f9036058b40b2c23052d8226711ac5c.png differ diff --git a/assets/images/pp/9a1f344bc68815fa15bb0a1e16017ee6.png b/assets/images/pp/9a1f344bc68815fa15bb0a1e16017ee6.png new file mode 100644 index 00000000..bdd582a6 Binary files /dev/null and b/assets/images/pp/9a1f344bc68815fa15bb0a1e16017ee6.png differ diff --git a/assets/images/pp/e607963d306a19d1df94c50d577ea439.jpg b/assets/images/pp/e607963d306a19d1df94c50d577ea439.jpg new file mode 100644 index 00000000..cde64514 Binary files /dev/null and b/assets/images/pp/e607963d306a19d1df94c50d577ea439.jpg differ diff --git a/src/pages/other/account_settings.php b/src/pages/other/account_settings.php index e99b3114..60c683b3 100644 --- a/src/pages/other/account_settings.php +++ b/src/pages/other/account_settings.php @@ -168,12 +168,8 @@ $user = $result->fetch_assoc(); data: formData, contentType: false, processData: false, + dataType: 'json', success: function(response) { - // Parse response if needed - if (typeof response === "string") { - response = JSON.parse(response); - } - if (response.status === 'success') { $('#responseMessage').html('
' + response.message + '
'); // Reload the current page after a short delay @@ -184,8 +180,10 @@ $user = $result->fetch_assoc(); $('#responseMessage').html('
' + response.message + '
'); } }, - error: function() { - $('#responseMessage').html('
Error uploading profile picture.
'); + error: function(xhr, status, error) { + console.log('AJAX Error:', status, error); + console.log('Response Text:', xhr.responseText); + $('#responseMessage').html('
Error uploading profile picture: ' + error + '
'); } }); }); diff --git a/src/processors/upload_profile_picture.php b/src/processors/upload_profile_picture.php index e31a4f56..b942d9b0 100644 --- a/src/processors/upload_profile_picture.php +++ b/src/processors/upload_profile_picture.php @@ -6,6 +6,9 @@ require_once($rootPath . "/src/config/session.php"); include_once($rootPath . '/src/config/connection.php'); require_once($rootPath . "/src/config/functions.php"); +// Set JSON response header +header('Content-Type: application/json'); + // Check database connection if (!isset($conn) || $conn === null) { die(json_encode(['status' => 'error', 'message' => 'Database connection failed']));