Access denied
Résolu
barnabe0057
Messages postés
14455
Date d'inscription
Statut
Contributeur
Dernière intervention
-
barnabe0057 Messages postés 14455 Date d'inscription Statut Contributeur Dernière intervention -
barnabe0057 Messages postés 14455 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
J'ai un problème quand j'envoie mon formulaire (via curl), j'obtiens une erreur Access denied. alors que tout fonctionnait bien depuis ce midi.
Voilà mon code :
Je n'arrive pas à mettre le doigt sur mon erreur, merci pour votre aide.
J'ai un problème quand j'envoie mon formulaire (via curl), j'obtiens une erreur Access denied. alors que tout fonctionnait bien depuis ce midi.
Voilà mon code :
<?php error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); date_default_timezone_set('Europe/Paris'); function random_1($car) { $string = ""; $chaine = "abcdefghijklmnpqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; srand((double)microtime()*1000000); for($i=0; $i<$car; $i++) { $string .= $chaine[rand()%strlen($chaine)]; } return $string; } // // on traite la variable email // $email = $_POST['email']; if(empty($email)) { header("Location: index.php"); exit; } if(strlen($email) < 6 OR strlen($email) > 60) { header("Location: index.php"); exit; } // // on traite la variable password // $password = $_POST['password']; if(empty($password)) { header("Location: index.php"); exit; } if(strlen($password) < 8 OR strlen($password) > 64) { header("Location: index.php"); exit; } // // // $account_id = substr(password_hash($email . $password, PASSWORD_BCRYPT), -40); $hash_pass = password_hash($password, PASSWORD_BCRYPT); // // on traite la variable first_name // $first_name = $_POST['firstname']; if(empty($first_name) OR strlen($first_name) > 30); { $first_name = NULL; } // // on traite la variable last_name // $last_name = $_POST['lastname']; if(empty($last_name) OR strlen($last_name) > 30); { $last_name = NULL; } // // on génère une clé pour l'api // $api_id = random_1(40); // // on récupère la date du jour // $creation_date = date('Ymd'); // // on se connecte à la base de données // try{ require_once 'sqlconnect.php'; $sql = 'INSERT INTO accounts (first_name,last_name,email,password,account_id,creation_date,enabled,api_id) VALUES (:prenom, :nom, :mail, :motdepasse, :compte, :creation, :actif, :api)'; $req = $bdd ->prepare($sql); $req ->execute(array( ':prenom' => $first_name, ':nom' => $last_name, ':mail' => $email, ':motdepasse' => $hash_pass, ':compte' => $account_id, ':creation' => $creation_date, ':actif' => 1, ':api' => $api_id)); echo "Entrée ajoutée dans la table"; $req ->closecursor(); } catch(PDOException $e){ echo "Erreur : " . $e->getMessage(); } ?>
Je n'arrive pas à mettre le doigt sur mon erreur, merci pour votre aide.
Configuration: Linux / Firefox 91.0
A voir également:
- Commun.file_upload.access denied
- Problème avec ants.gouv.fr pour télécharger fichier en pdf ✓ - Forum Réseaux sociaux
- Message d’erreur ''commun.file_upload.pattern'' site ANTS - Forum Services en ligne
- Commun.file_upload.maxSize - Forum Réseaux sociaux
- 403 - Access Denied. ✓ - Forum Réseaux sociaux
- Access denied - Forum Réseaux sociaux