Fix: Profile picture upload AJAX response handling
- Add dataType: 'json' to AJAX call to properly parse JSON response - Add Content-Type header to upload_profile_picture.php - Add error callback with console logging for debugging - Remove manual JSON parsing since jQuery handles it with dataType
This commit is contained in:
@@ -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']));
|
||||
|
||||
Reference in New Issue
Block a user