當前位置: 首頁>>代碼示例>>PHP>>正文


PHP funciones::isAjax方法代碼示例

本文整理匯總了PHP中funciones::isAjax方法的典型用法代碼示例。如果您正苦於以下問題:PHP funciones::isAjax方法的具體用法?PHP funciones::isAjax怎麽用?PHP funciones::isAjax使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在funciones的用法示例。


在下文中一共展示了funciones::isAjax方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: login

function login()
{
    $msg = new messages();
    $fun = new funciones();
    if (!$fun->isAjax()) {
        header("Location: login.php");
    }
    $con = new con();
    $con->connect();
    $response = new StdClass();
    $usu = $_POST['usr'];
    $pass = $_POST['psw'];
    $pass = sha1(md5($pass));
    /*Consulta a la Bd*/
    $selectSQL = "SELECT * FROM `tbl_users` WHERE `us_usuario` = '{$usu}' AND `us_clave` = '{$pass}' AND us_estado = 1";
    $row_cons = mysql_query($selectSQL);
    $existe = mysql_fetch_assoc($row_cons);
    /*Termina Consulta*/
    /*Existe*/
    //$existe = 1;
    if ($existe) {
        $res = true;
        $mes = "panel.html";
        $_SESSION["ses_id"] = $existe['us_id'];
        //$menu = 1;
    } else {
        $res = false;
        $mes = $msg->get_msg("e002");
    }
    $response->res = $res;
    $response->mes = $mes;
    echo json_encode($response);
    $con->disconnect();
}
開發者ID:alchemixt99,項目名稱:book_store,代碼行數:34,代碼來源:login.php

示例2: add_pack

<?php

session_start();
require "funciones.php";
require "messages.php";
$fun = new funciones();
if (!$fun->isAjax()) {
    header("Location: ../../mods/panel/panel.php");
}
//=============Definimos funciones===================
//agregar remisiones
function add_pack()
{
    $msg = new messages();
    $response = new StdClass();
    /*recibimos variables*/
    $ini = $_POST["ini"];
    $fin = $_POST["fin"];
    $inter = $_POST["inter"];
    $per = $_POST["per"];
    if ($ini == "" || $fin == "" || $inter == "") {
        $res = false;
        $mes = $msg->get_msg("e005");
    } else {
        $con = new con();
        $con->connect();
        /* ingresamos datos de la finca */
        $qry = "INSERT INTO tbl_remisiones_fisicas (rf_persona_entrega, rf_interventor, rf_dig_ini, rf_dig_fin, rf_created, rf_estado)\n\t\t\t\t\tVALUES ('" . $per . "','" . $inter . "'," . $ini . "," . $fin . "," . $_SESSION["ses_id"] . ",1);";
        $resp = mysql_query($qry);
        if (!$resp) {
            $res = false;
開發者ID:alchemixt99,項目名稱:STL,代碼行數:31,代碼來源:ajax_rfisicas.php

示例3: json_encode

<?php

session_start();
require "../php/funciones.php";
$fx = new funciones();
if (!$fx->isAjax()) {
    header("Location: ../pages/index.html");
}
$con = new con();
$con->connect();
$response = new StdClass();
$usuario = $_POST['us'];
$pass = $_POST['ps'];
$pass = sha1(md5($pass));
/*Actualizamos la contraseña del usuario*/
$row_verif = mysql_query("UPDATE tbl_users SET us_clave='" . $pass . "' WHERE us_id=" . $usuario . ";");
if (!$row_verif) {
    $res = false;
    $mes = "Error al cambiar contraseña.";
} else {
    $res = true;
    $mes = "Cambio registrado con éxito.";
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
$con->disconnect();
開發者ID:alchemixt99,項目名稱:iepProc,代碼行數:27,代碼來源:change_pass.php


注:本文中的funciones::isAjax方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。