+ * @todo delete old_message_die method and write alternative HTML textual output
+ * in the message_die method
+ */
-//Constantes
+///
+/// Error constants
+///
+
+/**
+ * SQL_ERROR is the constant meaning the error is a SQL error.
+ *
+ * As a message_die function parameter, it allows to add SQL specific debug information.
+ */
define ("SQL_ERROR", 65);
+
+/**
+ * HACK_ERROR is the constant meaning access is non authorized to the resource.
+ *
+ * It encompasses two problematics:
+ * the URL points to a resource belonging to another user or for the current user have no access right (for malformed URL, pick instead GENERAL_ERROR) ;
+ * the user is anonymous, instead to be logged in.
+ *
+ * A suggested way to handle the second problematic is to store in hidden input
+ * fields or better in the session the previous form data, and to print a login
+ * form.
+ *
+ * If you implement this, you don't even need to distinguishes between the two
+ * cases, as once logged in, the regular HACK_ERROR could also be printed.
+ */
define ("HACK_ERROR", 99);
+
+/**
+ * GENERAL_ERROR is the constant meaning the error is general, ie not covered by
$sql = "SELECT c.*, p.perso_nickname, p.perso_name FROM content c, persos p WHERE c.location_global = '$location_global' AND c.location_local = '$location_local' AND p.perso_id = c.perso_id ORDER BY location_k ASC";
if (!$result = $db->sql_query($sql)) {
message_die(SQL_ERROR, "Can't get content", '', __LINE__, __FILE__, $sql);