fixed photo quotations
This commit is contained in:
parent
df5e6d5656
commit
57ddd4bb5a
@ -8,8 +8,8 @@ $file = $_FILES['file'] ?? null;
|
||||
$filename = $_POST['filename'] ?? null;
|
||||
$idquotations = $_POST['idquotations'] ?? null;
|
||||
|
||||
if (!$file || !$filename || !$idquotations) {
|
||||
echo json_encode(['success' => false, 'message' => 'Dati mancanti']);
|
||||
if (!$file || !$filename || !$idquotations || !isset($iduserlogin)) {
|
||||
echo json_encode(['success' => false, 'message' => 'Dati mancanti o utente non autenticato']);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ if (!in_array($file['type'], $allowedTypes)) {
|
||||
try {
|
||||
$dbHandler = DBHandlerSelect::getInstance();
|
||||
$pdo = $dbHandler->getConnection();
|
||||
$stmt = $pdo->prepare("SELECT idquotations FROM quotations WHERE idquotations = :idquotations");
|
||||
$stmt = $pdo->prepare("SELECT id FROM quotations WHERE id = :idquotations");
|
||||
$stmt->execute([':idquotations' => $idquotations]);
|
||||
if (!$stmt->fetch()) {
|
||||
echo json_encode(['success' => false, 'message' => 'idquotations non valido']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user