当前位置: 首页>>代码示例>>PHP>>正文


PHP unslashes函数代码示例

本文整理汇总了PHP中unslashes函数的典型用法代码示例。如果您正苦于以下问题:PHP unslashes函数的具体用法?PHP unslashes怎么用?PHP unslashes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了unslashes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_form_var

function get_form_var($variable, $type = 'string')
{
    // We use some functions from here
    // require_once "functions.inc";
    if ($type == 'array') {
        $value = array();
    } else {
        $value = NULL;
    }
    if (!empty($_POST) && isset($_POST[$variable])) {
        if ($type == 'array') {
            $value = (array) $_POST[$variable];
        } else {
            $value = $_POST[$variable];
        }
    } else {
        if (!empty($HTTP_POST_VARS) && isset($HTTP_POST_VARS[$variable])) {
            if ($type == 'array') {
                $value = (array) $HTTP_POST_VARS[$variable];
            } else {
                $value = $HTTP_POST_VARS[$variable];
            }
        }
    }
    if (!empty($_GET) && isset($_GET[$variable])) {
        if ($type == 'array') {
            $value = (array) $_GET[$variable];
        } else {
            $value = $_GET[$variable];
        }
    } else {
        if (!empty($HTTP_GET_VARS) && isset($HTTP_GET_VARS[$variable])) {
            if ($type == 'array') {
                $value = (array) $HTTP_GET_VARS[$variable];
            } else {
                $value = $HTTP_GET_VARS[$variable];
            }
        }
    }
    if ($value != NULL) {
        if ($type == 'int') {
            $value = intval(unslashes($value));
        } else {
            if ($type == 'string') {
                $value = unslashes($value);
            } else {
                if ($type == 'array') {
                    foreach ($value as $arrkey => $arrvalue) {
                        $value[$arrkey] = unslashes($arrvalue);
                    }
                }
            }
        }
    }
    return $value;
}
开发者ID:gallantlauo,项目名称:phpcheckout,代码行数:56,代码来源:grab_globals.inc.php

示例2: get_form_var

function get_form_var($variable, $type = 'string')
{
    // We use some functions from here
    //require_once "functions.inc";
    global $cli_params, $allow_cli;
    // Set the default value, and make sure it's the right type
    if (func_num_args() > 2) {
        $value = func_get_arg(2);
        $value = $type == 'array' ? (array) $value : $value;
    } else {
        $value = $type == 'array' ? array() : NULL;
    }
    // Get the command line arguments if any (and we're allowed to),
    // otherwise get the POST variables
    if ($allow_cli && (!empty($cli_params) && isset($cli_params[$variable]))) {
        $value = $cli_params[$variable];
    } else {
        if (!empty($_POST) && isset($_POST[$variable])) {
            $value = $_POST[$variable];
        } else {
            if (!empty($HTTP_POST_VARS) && isset($HTTP_POST_VARS[$variable])) {
                $value = $HTTP_POST_VARS[$variable];
            }
        }
    }
    // Then get the GET variables
    if (!empty($_GET) && isset($_GET[$variable])) {
        $value = $_GET[$variable];
    } else {
        if (!empty($HTTP_GET_VARS) && isset($HTTP_GET_VARS[$variable])) {
            $value = $HTTP_GET_VARS[$variable];
        }
    }
    // Cast to an array if necessary
    if ($type == 'array') {
        $value = (array) $value;
    }
    // Clean up the variable
    if ($value != NULL) {
        if ($type == 'int') {
            $value = intval(unslashes($value));
        } else {
            if ($type == 'string') {
                $value = unslashes($value);
            } else {
                if ($type == 'array') {
                    foreach ($value as $arrkey => $arrvalue) {
                        $value[$arrkey] = unslashes($arrvalue);
                    }
                }
            }
        }
    }
    return $value;
}
开发者ID:cvelayo,项目名称:worklog,代码行数:55,代码来源:grab_globals.inc.php

示例3: isset

				if($defaut_gab=="y"){
					$value_gab="selected='selected'";
					$gabarit=$lig_gab->repertoire;
				}else{
					$value_gab="";
				}
			$tbs_dossier_gabarit[]=array("texte"=>$texte_gab, "selection"=>$value_gab, "value"=>$repertoire_gab);	
			}
		}
		
	}else{
		$gabarit="origine";
	}

	if ((isset($_GET['template'])) or (isset($_POST['template'])) or (isset($gabarit))) {
		$gabarit = isset($_POST['template']) ? unslashes($_POST['template']) : (isset($_GET['template']) ? unslashes($_GET['template']) : $gabarit);
	}
	else{
		$gabarit="origine";
	}
	

	
//==================================
// Décommenter la ligne ci-dessous pour afficher les variables $_GET, $_POST, $_SESSION et $_SERVER pour DEBUG:
//debug_var();

// appel des bibliothèques tinyButStrong

		
$_SESSION['tbs_class'] = 'tbs/tbs_class.php';
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:login.php

示例4: mb_substr

// Traitement du nouveau nom de la salle
if (isset($new_name) and $new_name != "") {
    $nettoyage1 = mb_substr($new_name, 0, 30);
    $new_name_propre = traitement_magic_quotes($nettoyage1);
    // cette fonction est dans le traitement_data.inc.php
    $req_modif_nom = mysqli_query($GLOBALS["mysqli"], "UPDATE salle_cours SET nom_salle = '{$new_name_propre}' WHERE id_salle = '{$modif_salle}'") or trigger_error('Echec dans le changement de nom', E_USER_WARNING);
    $req_numero = mysqli_query($GLOBALS["mysqli"], "SELECT numero_salle FROM salle_cours WHERE id_salle = '{$modif_salle}'") or trigger_error('Echec dans le changement du nom', E_USER_WARNING);
    $rep_numero = mysqli_fetch_array($req_numero);
    $num_salle = $rep_numero["numero_salle"];
    echo '		</td>
			</tr>
			<tr>
				<td></td>
				<td>
	<span class="accept">';
    printf(CHANGE_CLASSROOM_NAME, $num_salle, unslashes($new_name_propre));
    echo '</span>
		</form>';
}
?>
				</td>
			</tr>
		</table>
<br />
</fieldset>

<br />

	<form action="ajouter_salle.php" name="effacer_salle" method="post">

<fieldset id="enlever">
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:ajouter_salle.php

示例5: traite_grr_url

        echo "<hr />\n";
    }
    // Affichage d'un lien pour format imprimable
    if ((!isset($_GET['pview']) || $_GET['pview'] != 1) && ($summarize != 4 && $summarize != 5)) {
        echo '<p style="text-align:center;">
							<a href="' . traite_grr_url("", "y") . "report.php" . '?' . htmlspecialchars($_SERVER['QUERY_STRING']) . '&amp;pview=1" ';
        if (Settings::get("pview_new_windows") == 1) {
            echo ' target="_blank"';
        }
        echo '><span class="glyphicon glyphicon-print"></span></a>
						</p>';
    }
    //S'assurer que ces paramètres ne sont pas cités.
    $k = 0;
    while ($k < count($texte)) {
        $texte[$k] = unslashes($texte[$k]);
        $k++;
    }
    //Les heures de début et de fin sont aussi utilisés pour mettre l'heure dans le rapport.
    $report_start = mktime(0, 0, 0, $From_month, $From_day, $From_year);
    $report_end = mktime(0, 0, 0, $To_month, $To_day + 1, $To_year);
    //   La requête SQL va contenir les colonnes suivantes:
    // Col Index  Description:
    //   1  [0]   Entry ID, Non affiché -> e.id
    //   2  [1]   Date de début (Unix) -> e.start_time
    //   3  [2]   Date de fin (Unix) -> e.end_time
    //   4  [3]   Descrition brêve,(HTML) -> e.name
    //   5  [4]   Descrition,(HTML) -> e.description
    //   6  [5]   Type -> e.type
    //   7  [6]   réservé par (nom ou IP), (HTML) -> e.beneficiaire
    //   8  [7]   Timestamp (création), (Unix) -> e.timestamp
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:report.php

示例6: print_header

}
print_header($day, $month, $year, isset($area) ? $area : "");
// If area is set but area name is not known, get the name.
if (isset($area)) {
    if (empty($area_name)) {
        $res = sql_query("select area_name from mrbs_area where id={$area}");
        if (!$res) {
            fatal_error(0, sql_error());
        }
        if (sql_count($res) == 1) {
            $row = sql_row($res, 0);
            $area_name = $row[0];
        }
        sql_free($res);
    } else {
        $area_name = unslashes($area_name);
    }
}
?>

<h2><?php 
echo $vocab['administration'];
?>
</h2>

<table border=1>
<tr>
<th><center><b><?php 
echo $vocab['areas'];
?>
</b></center></th>
开发者ID:verdurin,项目名称:mrbs-mcr,代码行数:31,代码来源:admin.php

示例7: htmlspecialchars

$back = '';
if (isset($_SERVER['HTTP_REFERER'])) {
    $back = htmlspecialchars($_SERVER['HTTP_REFERER']);
}
check_access(6, $back);
// Restriction dans le cas d'une démo
VerifyModeDemo();
unset($user_login);
$user_login = isset($_POST["user_login"]) ? $_POST["user_login"] : ($user_login = isset($_GET["user_login"]) ? $_GET["user_login"] : NULL);
$valid = isset($_POST["valid"]) ? $_POST["valid"] : NULL;
$msg = '';
if ($valid == "yes") {
    unset($reg_password1);
    $reg_password1 = unslashes($_POST["reg_password1"]);
    unset($reg_password2);
    $reg_password2 = unslashes($_POST["reg_password2"]);
    $reg_password_c = md5($reg_password1);
    if ($reg_password1 != $reg_password2 || strlen($reg_password1) < $pass_leng) {
        $msg = get_vocab("passwd_error");
    } else {
        $sql = "UPDATE " . TABLE_PREFIX . "_utilisateurs SET password='" . protect_data_sql($reg_password_c) . "' WHERE login='{$user_login}'";
        if (grr_sql_command($sql) < 0) {
            fatal_error(0, get_vocab('update_pwd_failed') . grr_sql_error());
        } else {
            $msg = get_vocab('update_pwd_succeed');
        }
    }
}
$user_nom = '';
$user_prenom = '';
$user_source = '';
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:admin_change_pwd.php

示例8: while

        $i++;
    } while ($i < $_POST['indice_max_log_eleve']);
}
if (isset($_POST['appreciations'])) {
    check_token();
    $temp = $_POST['appreciations'] . " 1";
    // Sous Linux, on n'envoie que des \n
    if (preg_match("/\\\\r/", $temp)) {
        // Cas Window$ et Mac
        $temp = my_ereg_replace("\\\\r", "`", $temp);
        $temp = my_ereg_replace("\\\\n", "", $temp);
    } elseif (preg_match("/\\\\n/", $temp)) {
        // Cas Linux
        $temp = my_ereg_replace("\\\\n", "`", $temp);
    }
    $temp = unslashes($temp);
    $longueur = mb_strlen($temp);
    $i = 0;
    $fin_app = 'yes';
    $indice = $_POST['debut_import'] - 2;
    $tempo = "";
    while ($i < $longueur and $indice < $_POST['fin_import']) {
        $car = mb_substr($temp, $i, 1);
        if (!my_ereg("^[`]{1}\$", $car)) {
            if ($fin_app == 'yes' or $i == $longueur - 1) {
                $fin_app = 'no';
                $appreciations_import[$indice] = $tempo;
                $indice++;
                $tempo = '';
            }
            $tempo = $tempo . $car;
开发者ID:alhousseyni,项目名称:gepi,代码行数:31,代码来源:saisie_notes.php

示例9: unslashes

}
# This file is for adding new areas/rooms
# we need to do different things depending on if its a room
# or an area
if ($type == "area") {
    $area_name_q = unslashes($name);
    $id = $mdb->nextId("{$tbl_area}_id");
    if (MDB::isError($id)) {
        fatal_error(1, "<p>" . $id->getMessage() . "<br>" . $id->getUserInfo());
    }
    $sql = "INSERT INTO {$tbl_area} (id, area_name) \n            VALUES      ({$id}, " . $mdb->getTextValue($area_name_q) . ")";
    $res = $mdb->query($sql);
    if (MDB::isError($res)) {
        fatal_error(1, "<p>" . $res->getMessage() . "<br>" . $res->getUserInfo());
    }
    $area = $mdb->currId("{$tbl_area}_id");
}
if ($type == "room") {
    $room_name_q = unslashes($name);
    $description_q = unslashes($description);
    if (empty($capacity)) {
        $capacity = 0;
    }
    $id = $mdb->nextId("{$tbl_room}_id");
    $sql = "INSERT INTO {$tbl_room} (id, room_name, area_id, description, capacity)\n            VALUES      ({$id}, " . $mdb->getTextValue($room_name_q) . ", {$area}, " . $mdb->getTextValue($description_q) . ", {$capacity})";
    $res = $mdb->query($sql);
    if (MDB::isError($res)) {
        fatal_error(1, "<p>" . $res->getMessage() . "<br>" . $res->getUserInfo());
    }
}
header("Location: admin.php?area={$area}");
开发者ID:verdurin,项目名称:mrbs-mcr,代码行数:31,代码来源:add.php

示例10: unslashes

     $message .= "\n\n";
     $message .= "Bizarrerie: L'identité POSTée est: {$nama}\n            Et l'identité de connexion est: " . $_SESSION['prenom'] . " " . $_SESSION['nom'];
 }
 unslashes($message);
 $gepiPrefixeSujetMail = getSettingValue("gepiPrefixeSujetMail") ? getSettingValue("gepiPrefixeSujetMail") : "";
 if ($gepiPrefixeSujetMail != '') {
     $gepiPrefixeSujetMail .= " ";
 }
 $gepiAdminAdress = getSettingValue("gepiAdminAdress");
 if ($gepiAdminAdress == "") {
     echo "<p><span style='color:red;>ERREUR</span>: L'adresse mail de l'administrateur n'est pas renseignée.</p>\n";
     require "../lib/footer.inc.php";
     die;
 }
 $objet_msg = trim($objet_msg);
 unslashes($objet_msg);
 //echo "\$objet_msg=$objet_msg<br />";
 //stripslashes($objet_msg);
 //if($objet_msg=='') {$objet_msg="Demande d'aide dans GEPI";}
 $subject = $gepiPrefixeSujetMail . $objet_msg;
 $subject = "=?UTF-8?B?" . base64_encode($subject) . "?=\r\n";
 $from = $email_reponse != "" ? "{$nama} <{$email_reponse}>" : $gepiAdminAdress;
 $headers = "X-Mailer: PHP/" . phpversion() . "\r\n";
 $headers .= "MIME-Version: 1.0\r\n";
 $headers .= "Content-type: text/plain; charset=UTF-8\r\n";
 $headers .= "From: {$from}\r\n";
 if ($email_reponse != "") {
     $headers .= "Reply-To: {$from}\r\n";
     if (getSettingValue("gepiAdminAdressFormHidden") != "y") {
         $headers .= "Cc: {$nama} <{$email_reponse}>\r\n";
     }
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:contacter_admin.php

示例11: htaccess

 $ht = new htaccess(TRUE);
 $user = array();
 // Get the logins from the password file
 $user = $ht->get_htpasswd();
 // Add an Administrator
 if (empty($_POST['pwd1_backup']) || empty($_POST['pwd2_backup'])) {
     $msg = "Problème : les deux mots de passe ne sont pas identiques ou sont vides.";
     $error = 1;
 } elseif ($_POST['pwd1_backup'] != $_POST['pwd2_backup']) {
     $msg = "Problème : les deux mots de passe ne sont pas identiques.";
     $error = 1;
 } elseif (empty($_POST['login_backup'])) {
     $msg = "Problème : l'identifiant est vide.";
     $error = 1;
 } else {
     $_login = my_strtolower(unslashes($_POST['login_backup']));
     if (is_array($user)) {
         foreach ($user as $key => $value) {
             if ($_login == $key) {
                 $ht->delete_user($_login);
             }
         }
     }
 }
 if (!isset($error)) {
     $ht->set_user($_login, $_POST['pwd1_backup']);
     $ht->set_htpasswd();
     $user = array();
     $user = $ht->get_htpasswd();
     clearstatcache();
     if (!is_file('../backup/' . $dirname . '/.htaccess')) {
开发者ID:alhousseyni,项目名称:gepi,代码行数:31,代码来源:accueil_sauve.php

示例12: array

$etiquettex = array();
$k="1";
while ($k < $nb_data) {
 $datay[$k] = array();
 $temp[$k] =  array();
 $temp[$k]=explode("|", $_GET['temp'.$k]);
 $k++;
}

$legendy = array();
$temp3=explode("|", $_GET['etiquette']);
$titre = unslashes($_GET['titre']);
$k = 1;
while ($k < $nb_data) {
    if (isset($_GET['v_legend'.$k])) {
        $legendy[$k] = unslashes(urldecode($_GET['v_legend'.$k]));
    } else {
        $legendy[$k]='' ;
    }
    $k++;
}

$i=0;
while ($i < count($temp[1])) {
    $k="1";
    while ($k < $nb_data) {
        $datay[$k][$i] = $temp[$k][$i];
        $k++;
    }
/*
    // On ne transmet plus l'id_matiere dans 'etiquette', mais le nom_complet.
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:draw_artichow1.php

示例13: VerifyModeDemo

$user_mail = '';
$user_statut = '';
$user_source = 'local';
$user_etat = '';
$user_tel = '';
$user_champs_libre = '';
$display = '';
$retry = '';
if ($valid == 'yes') {
    // Restriction dans le cas d'une démo
    VerifyModeDemo();
    $reg_nom = isset($_GET['reg_nom']) ? $_GET['reg_nom'] : null;
    $reg_prenom = isset($_GET['reg_prenom']) ? $_GET['reg_prenom'] : null;
    $new_login = isset($_GET['new_login']) ? $_GET['new_login'] : null;
    $reg_password = isset($_GET['reg_password']) ? unslashes($_GET['reg_password']) : null;
    $reg_password2 = isset($_GET['reg_password2']) ? unslashes($_GET['reg_password2']) : null;
    $reg_statut = isset($_GET['reg_statut']) ? $_GET['reg_statut'] : null;
    $reg_email = isset($_GET['reg_email']) ? $_GET['reg_email'] : null;
    $reg_etat = isset($_GET['reg_etat']) ? $_GET['reg_etat'] : null;
    $reg_source = isset($_GET['reg_source']) ? $_GET['reg_source'] : null;
    $reg_tel = isset($_GET['reg_tel']) ? $_GET['reg_tel'] : null;
    $reg_champs_libre = isset($_GET['reg_champs_libre']) ? $_GET['reg_champs_libre'] : null;
    $reg_type_authentification = isset($_GET['type_authentification']) ? $_GET['type_authentification'] : 'locale';
    if ($reg_type_authentification != 'locale') {
        $reg_password = '';
    }
    if ($reg_nom == '' || $reg_prenom == '') {
        $msg = get_vocab('please_enter_name');
        $retry = 'yes';
    } else {
        //
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:admin_user_modify.php

示例14: array

  Target of the form with sets the URL argument "Action=SetName".
  Will eventually return to URL argument "TargetURL=whatever".
*/
if (isset($Action) && $Action == "SetName") {
    /* First make sure the password is valid */
    if ($NewUserName == "") {
        // Unset the session variables
        if (isset($_SESSION)) {
            $_SESSION = array();
        } else {
            global $HTTP_SESSION_VARS;
            $HTTP_SESSION_VARS = array();
        }
    } else {
        $NewUserName = unslashes($NewUserName);
        $NewUserPassword = unslashes($NewUserPassword);
        if (!authValidateUser($NewUserName, $NewUserPassword)) {
            print_header_mrbs(0, 0, 0, 0);
            echo "<P>" . get_string('usernamenotfound') . "</P>\n";
            printLoginForm($TargetURL);
            exit;
        }
        if (isset($_SESSION)) {
            $_SESSION["UserName"] = $NewUserName;
        } else {
            global $HTTP_SESSION_VARS;
            $HTTP_SESSION_VARS["UserName"] = $NewUserName;
        }
    }
    header("Location: {$TargetURL}");
    /* Redirect browser to initial page */
开发者ID:rtsfc,项目名称:moodle-block_mrbs,代码行数:31,代码来源:session_php.php

示例15: switch

		//chaine_mel += "&body=Bonjour";
		location.href = chaine_mel;
	}


-->
</script>
<?php

switch($action)
{

//envoi du message
case "envoi":
    //N.B. pour peaufiner, mettre un script de vérification de l'adresse email et du contenu du message !
    $message = "Demandeur : ".$nama."\nEtablissement : ".getSettingValue("gepiSchoolName")."\n".unslashes($message);
    if ($email_reponse == '') {
        echo "<br /><br /><br /><P style=\"text-align: center\">Votre message n'a pas été envoyé : vous devez indiquer une adresse e-mail pour la réponse !</p>";
    } else {
		$gepiPrefixeSujetMail=getSettingValue("gepiPrefixeSujetMail") ? getSettingValue("gepiPrefixeSujetMail") : "";
		if($gepiPrefixeSujetMail!='') {$gepiPrefixeSujetMail.=" ";}

        $from = $email_reponse != "" ? "$nama <$email_reponse>" : getSettingValue("gepiAdminAdress");

        $subject = $gepiPrefixeSujetMail."Demande d'aide dans GEPI";
        $subject = "=?UTF-8?B?".base64_encode($subject)."?=\r\n";

        $headers = "X-Mailer: PHP/" . phpversion()."\r\n";
        $headers .= "MIME-Version: 1.0\r\n";
        $headers .= "Content-type: text/plain; charset=UTF-8\r\n";
        $headers .= "From: $from\r\n";
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:contacter_admin_pub.php


注:本文中的unslashes函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。