• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP set_session函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: make_mp3

function make_mp3()
{
    global $config;
    $number = get_session("ss_captcha_key");
    if ($number == "") {
        return;
    }
    if ($number == get_session("ss_captcha_save")) {
        return;
    }
    $mp3s = array();
    for ($i = 0; $i < strlen($number); $i++) {
        $file = G5_CAPTCHA_PATH . '/mp3/' . $config['cf_captcha_mp3'] . '/' . $number[$i] . '.mp3';
        $mp3s[] = $file;
    }
    $ip = sprintf("%u", ip2long($_SERVER['REMOTE_ADDR']));
    $mp3_file = 'data/cache/kcaptcha-' . $ip . '_' . G5_SERVER_TIME . '.mp3';
    $contents = '';
    foreach ($mp3s as $mp3) {
        $contents .= file_get_contents($mp3);
    }
    file_put_contents(G5_PATH . '/' . $mp3_file, $contents);
    // 지난 캡챠 파일 삭제
    if (rand(0, 99) == 0) {
        foreach (glob(G5_PATH . '/data/cache/kcaptcha-*.mp3') as $file) {
            if (filemtime($file) + 86400 < G5_SERVER_TIME) {
                @unlink($file);
            }
        }
    }
    set_session("ss_captcha_save", $number);
    return G5_URL . '/' . $mp3_file;
}
开发者ID:dingdong2310,项目名称:g5_theme,代码行数:33,代码来源:kcaptcha_mp3.php


示例2: default_login

function default_login($un, $pp)
{
    if ($un == "admin" && $pp == "admin123") {
        set_session($un, $pp);
        header("Location: main.php");
    }
}
开发者ID:raveenrox,项目名称:HomeControllerWebInterface,代码行数:7,代码来源:login.php


示例3: setSession

 private function setSession($id)
 {
     sec_session();
     set_session($id);
     header('Location: ../../pocetna/');
     die;
 }
开发者ID:bonetino,项目名称:Basic-CMS,代码行数:7,代码来源:prijava.php


示例4: login

 public function login()
 {
     global $PAGES;
     // get log in information
     $email = $this->session['login-email'];
     $password = $this->session['login-password'];
     $curr_user = null;
     foreach ($this->all_users as $id => $user) {
         if ($user->email === $email) {
             $curr_user = $user;
             break;
         }
     }
     clear_session();
     if ($curr_user !== null && password_verify($password, $curr_user->pass_salt_hash)) {
         // password correct
         set_session('user_id', $curr_user->id);
         set_session('user_session_token', hash("sha512", mt_rand(0, mt_getrandmax())));
         set_session('status', 'just_logged_in');
         $this->curr_user = $curr_user;
     } else {
         $this->status = 'wrong_login';
     }
     $this->view();
 }
开发者ID:ZhongxiaYan,项目名称:house_banking,代码行数:25,代码来源:login_controller.php


示例5: save2session

function save2session($key, $value)
{
    if (is_null($key) || is_null($value) || !is_string($key)) {
        return false;
    }
    //将键值对放入session中
    set_session($key, $value);
    return true;
}
开发者ID:omusico,项目名称:Social,代码行数:9,代码来源:session_manage.php


示例6: antiRePost

function antiRePost($sendStr)
{
    global $RefreshType;
    global $anit_refresh;
    if ($sendStr == get_session('PostSendStr')) {
        if (isset($RefreshType) == 'ajax') {
            action_return(2, 'error:' . $anit_refresh, "-1");
        } else {
            action_return(1, $anit_refresh, "-1");
        }
    }
    set_session('PostSendStr', $sendStr);
}
开发者ID:omusico,项目名称:Social,代码行数:13,代码来源:aanti_refresh.php


示例7: connect_error

function connect_error()
{
    global $connection, $token, $error, $drivers;
    $databases = array();
    if (DB != "") {
        page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true);
    } else {
        if ($_POST["db"] && !$error) {
            queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"]));
        }
        page_header(lang('Select database'), $error, false);
        echo "<p><a href='" . h(ME) . "database='>" . lang('Create new database') . "</a>\n";
        foreach (array('privileges' => lang('Privileges'), 'processlist' => lang('Process list'), 'variables' => lang('Variables'), 'status' => lang('Status')) as $key => $val) {
            if (support($key)) {
                echo "<a href='" . h(ME) . "{$key}='>{$val}</a>\n";
            }
        }
        echo "<p>" . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>{$connection->server_info}</b>", "<b>{$connection->extension}</b>") . "\n";
        echo "<p>" . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
        if ($_GET["refresh"]) {
            set_session("dbs", null);
        }
        $databases = get_databases();
        if ($databases) {
            $scheme = support("scheme");
            $collations = collations();
            echo "<form action='' method='post'>\n";
            echo "<table cellspacing='0' class='checkable' onclick='tableClick(event);'>\n";
            echo "<thead><tr><td>&nbsp;<th>" . lang('Database') . "<td>" . lang('Collation') . "<td>" . lang('Tables') . "</thead>\n";
            foreach ($databases as $db) {
                $root = h(ME) . "db=" . urlencode($db);
                echo "<tr" . odd() . "><td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]));
                echo "<th><a href='{$root}'>" . h($db) . "</a>";
                echo "<td><a href='{$root}" . ($scheme ? "&amp;ns=" : "") . "&amp;database=' title='" . lang('Alter database') . "'>" . nbsp(db_collation($db, $collations)) . "</a>";
                echo "<td align='right'><a href='{$root}&amp;schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>?</a>";
                echo "\n";
            }
            echo "</table>\n";
            echo "<script type='text/javascript'>tableCheck();</script>\n";
            echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /db/)", 1) . ">\n";
            // 1 - eventStop
            echo "<input type='hidden' name='token' value='{$token}'>\n";
            echo "<a href='" . h(ME) . "refresh=1' onclick='eventStop(event);'>" . lang('Refresh') . "</a>\n";
            echo "</form>\n";
        }
    }
    page_footer("db");
    if ($databases) {
        echo "<script type='text/javascript'>ajaxSetHtml('" . js_adminer_escape(ME) . "script=connect');</script>\n";
    }
}
开发者ID:nishant368,项目名称:newlifeoffice-new,代码行数:51,代码来源:connect.inc.php


示例8: get_user

 function get_user()
 {
     $cookie_user = ci_get_cookie('user');
     if ($cookie_user) {
         $this->user = json_decode($cookie_user, true);
         set_session('user', $this->user);
     } else {
         $this->user = get_session('user');
     }
     if ($this->user) {
         $this->uid = $this->user['uid'];
         $this->load->vars('user', $this->user);
     }
 }
开发者ID:chentaoz,项目名称:TourismWeb,代码行数:14,代码来源:MY_Controller.php


示例9: login

 function login()
 {
     $this->model->username = $_POST['username'];
     $this->model->userpwd = $_POST['userpwd'];
     $this->model->login_user();
     if ($this->model->rows > 0) {
         /*
          * 登录成功,注册变量
          */
         set_session('login', 'yes');
         set_session('userID', $this->model->result['id']);
         set_session('nickname', $this->model->result['nickname']);
     }
     header("Location:/admin");
 }
开发者ID:dalinhuang,项目名称:water-svn,代码行数:15,代码来源:index.php


示例10: login

 public function login()
 {
     if (IS_POST) {
         $user_name = I('post.user_name', '', 'htmlspecialchars');
         $pwd = I('post.password', '');
         if (empty($user_name) || empty($pwd)) {
             $this->error('Incorrect account address or password. Please try again.');
         }
         $info = D('Users')->UserLogin($user_name, $pwd);
         if ($info) {
             set_cookies($info, $_POST['remember']);
             set_session($info);
             $this->success('Login successful.', U('index/index'));
         }
         $this->error('Incorrect account address or password. Please try again.');
     }
 }
开发者ID:anshidai,项目名称:front_michael,代码行数:17,代码来源:AdminController.class.php


示例11: set_new_company

function set_new_company($id)
{
    set_session('company_id', $id);
    set_session('company_name', max_size(get_table_value('Companies', 'name', $id), 40));
    //   clean up previous [Company] search sessions
    unset_session('contact_search');
    unset_session('domain_search');
    unset_session('playlist_search');
    unset_session('user_search');
    unset_session('video_search');
    //   clean up previous [Company] page sessions
    unset_session('contact_page');
    unset_session('domain_page');
    unset_session('playlist_page');
    unset_session('user_page');
    unset_session('video_page');
}
开发者ID:shadobladez,项目名称:erp2,代码行数:17,代码来源:Specific.php


示例12: admin_login

function admin_login()
{
    safe('admin_login');
    global $smarty, $lang;
    $username = substr(post('username'), 0, 30);
    $password = substr(post('password'), 0, 30);
    if ($username == '' || $password == '') {
        unset_session('admin_username');
        unset_session('admin_password');
        $info_text = '对不起,用户名和密码不能为空';
        $link_text = '返回重新登录';
    } else {
        $password = md5($password);
        $obj = new admin();
        $obj->set_field('adm_id,adm_last_login');
        $obj->set_where("adm_username = '{$username}'");
        $obj->set_where("adm_password = '{$password}'");
        $one = $obj->get_one();
        if (count($one) !== 0) {
            set_session('session_id', session_id());
            set_session('admin_username', $username);
            set_session('admin_password', $password);
            $adm_id = $one['adm_id'];
            $adm_prev_login = $one['adm_last_login'];
            $adm_last_login = time();
            $obj->set_value('adm_prev_login', $adm_prev_login);
            $obj->set_value('adm_last_login', $adm_last_login);
            $obj->set_where('');
            $obj->set_where("adm_id = {$adm_id}");
            $obj->edit();
            $info_text = '欢迎使用新秀文章管理系统后台';
            $link_text = '进入后台';
        } else {
            unset_session('session_id');
            unset_session('admin_username');
            unset_session('admin_password');
            $info_text = '对不起,用户名不存在或密码不正确';
            $link_text = '返回重新登录';
        }
    }
    $smarty->assign('info_text', $info_text);
    $smarty->assign('link_text', $link_text);
    $smarty->assign('link_href', $_SERVER['PHP_SELF']);
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:44,代码来源:info_main.php


示例13: csrf_token

function csrf_token($name)
{
    if (function_exists('hash_algos') && in_array('sha512', hash_algos())) {
        $token = hash('sha512', mt_rand(0, mt_getrandmax()));
    } else {
        $token = '';
        for ($i = 0; $i < 128; ++$i) {
            $r = mt_rand(0, 35);
            if ($r < 26) {
                $c = chr(ord('a') + $r);
            } else {
                $c = chr(ord('0') + $r - 26);
            }
            $token .= $c;
        }
    }
    set_session($name, $token);
    return $token;
}
开发者ID:londomloto,项目名称:immortal,代码行数:19,代码来源:security.php


示例14: header

<?php

include_once "_common.php";
header("Content-Type: text/html; charset={$g4['charset']}");
require dirname(__FILE__) . '/kcaptcha_config.php';
include 'kcaptcha.php';
while (true) {
    $keystring = '';
    for ($i = 0; $i < $length; $i++) {
        $keystring .= $allowed_symbols[mt_rand(0, strlen($allowed_symbols) - 1)];
    }
    if (!preg_match('/cp|cb|ck|c6|c9|rn|rm|mm|co|do|cl|db|qp|qb|dp|ww/', $keystring)) {
        break;
    }
}
set_session("captcha_count", 0);
set_session("captcha_keystring", $keystring);
$captcha = new KCAPTCHA();
$captcha->setKeyString(get_session("captcha_keystring"));
开发者ID:jin255ff,项目名称:company_website,代码行数:19,代码来源:kcaptcha_session.php


示例15: md5

<?php

include_once './_common.php';
if (USE_G5_THEME && defined('G5_THEME_PATH')) {
    require_once G5_SHOP_PATH . '/yc/orderinquiryview.php';
    return;
}
// 불법접속을 할 수 없도록 세션에 아무값이나 저장하여 hidden 으로 넘겨서 다음 페이지에서 비교함
$token = md5(uniqid(rand(), true));
set_session("ss_token", $token);
if (!$is_member) {
    if (get_session('ss_orderview_uid') != $_GET['uid']) {
        alert("직접 링크로는 주문서 조회가 불가합니다.\\n\\n주문조회 화면을 통하여 조회하시기 바랍니다.", G5_SHOP_URL);
    }
}
$sql = "select * from {$g5['g5_shop_order_table']} where od_id = '{$od_id}' ";
if ($is_member && !$is_admin) {
    $sql .= " and mb_id = '{$member['mb_id']}' ";
}
$od = sql_fetch($sql);
if (!$od['od_id'] || !$is_member && md5($od['od_id'] . $od['od_time'] . $od['od_ip']) != get_session('ss_orderview_uid')) {
    alert("조회하실 주문서가 없습니다.", G5_SHOP_URL);
}
// 결제방법
$settle_case = $od['od_settle_case'];
// 주문상품
$item = array();
$arr_it_orderform = array();
$st_count1 = $st_count2 = 0;
$custom_cancel = false;
$sql = " select a.it_id,\n\t\t\t\ta.it_name,\n\t\t\t\ta.ct_send_cost,\n\t\t\t\ta.it_sc_type,\n\t\t\t\ta.pt_it,\n\t\t\t\tb.ca_id,\n\t\t\t\tb.ca_id2,\n\t\t\t\tb.ca_id3,\n\t\t\t\tb.pt_msg1,\n\t\t\t\tb.pt_msg2,\n\t\t\t\tb.pt_msg3\n\t\t  from {$g5['g5_shop_cart_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )\n\t\t  where a.od_id = '{$od_id}'\n\t\t  group by a.it_id\n\t\t  order by a.ct_id ";
开发者ID:peb317,项目名称:gbamn,代码行数:31,代码来源:orderinquiryview.php


示例16: urldecode

if ($member['mb_level'] >= $board['bo_write_level']) {
    $write_href = './write.php?bo_table=' . $bo_table;
}
// 답변 링크
$reply_href = '';
if ($member['mb_level'] >= $board['bo_reply_level']) {
    $reply_href = './write.php?w=r&amp;bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . $qstr;
}
// 수정, 삭제 링크
$update_href = $delete_href = '';
// 로그인중이고 자신의 글이라면 또는 관리자라면 비밀번호를 묻지 않고 바로 수정, 삭제 가능
if ($member['mb_id'] && $member['mb_id'] == $write['mb_id'] || $is_admin) {
    $update_href = './write.php?w=u&amp;bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . '&amp;page=' . $page . $qstr;
    $delete_href = './delete.php?bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . '&amp;page=' . $page . urldecode($qstr);
    if ($is_admin) {
        set_session("ss_delete_token", $token = uniqid(time()));
        $delete_href = './delete.php?bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . '&amp;token=' . $token . '&amp;page=' . $page . urldecode($qstr);
    }
} else {
    if (!$write['mb_id']) {
        // 회원이 쓴 글이 아니라면
        $update_href = './password.php?w=u&amp;bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . '&amp;page=' . $page . $qstr;
        $delete_href = './password.php?w=d&amp;bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . '&amp;page=' . $page . $qstr;
    }
}
// 최고, 그룹관리자라면 글 복사, 이동 가능
$copy_href = $move_href = '';
if ($write['wr_reply'] == '' && ($is_admin == 'super' || $is_admin == 'group')) {
    $copy_href = './move.php?sw=copy&amp;bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . '&amp;page=' . $page . $qstr;
    $move_href = './move.php?sw=move&amp;bo_table=' . $bo_table . '&amp;wr_id=' . $wr_id . '&amp;page=' . $page . $qstr;
}
开发者ID:eeewq123,项目名称:aaa,代码行数:31,代码来源:view.php


示例17: get_file

        $file = get_file($bo_table, $wr_id);
    } else {
        if ($w == 'r') {
            if (strstr($write['wr_option'], 'secret')) {
                $is_secret = true;
                $secret_checked = 'checked';
            }
            $password_required = "required";
            for ($i = 1; $i <= G5_LINK_COUNT; $i++) {
                $write['wr_link' . $i] = get_text($write['wr_link' . $i]);
            }
        }
    }
}
set_session('ss_bo_table', $_REQUEST['bo_table']);
set_session('ss_wr_id', $_REQUEST['wr_id']);
$subject = "";
if (isset($write['wr_subject'])) {
    $subject = str_replace("\"", "&#034;", get_text(cut_str($write['wr_subject'], 255), 0));
}
$content = '';
if ($w == '') {
    $content = $board['bo_insert_content'];
} else {
    if ($w == 'r') {
        if (!strstr($write['wr_option'], 'html')) {
            $content = "\n\n\n &gt; " . "\n &gt; " . "\n &gt; " . str_replace("\n", "\n> ", get_text($write['wr_content'], 0)) . "\n &gt; " . "\n &gt; ";
        }
    } else {
        $content = get_text($write['wr_content'], 0);
    }
开发者ID:dingdong2310,项目名称:g5_theme,代码行数:31,代码来源:write.php


示例18: synlogout

 function synlogout($get, $post)
 {
     if (! API_SYNLOGOUT) {
         return API_RETURN_FORBIDDEN;
     }
     
     header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
     set_cookie();
     set_session();
 }
开发者ID:sayi21cn,项目名称:ecshopAndEctouch,代码行数:10,代码来源:uc.php


示例19: Form1_action

function Form1_action($sAction)
{
    global $db;
    global $sForm1Err;
    global $sFileName;
    global $styles;
    switch (strtolower($sAction)) {
        case "login":
            //-------------------------------
            // Form1 Login begin
            //-------------------------------
            $sLogin = get_param("Login");
            $sPassword = get_param("Password");
            $sLogin = strtoupper($sLogin);
            $sPassword = substr(md5($sPassword), 1, 26);
            $db->query("SELECT USUA_LOGIN, CODI_NIVEL FROM USUARIO WHERE USUA_LOGIN =" . tosql($sLogin, "Text") . " AND USUA_PASW=" . tosql($sPassword, "Text"));
            $is_passed = $db->next_record();
            //-------------------------------
            // Form1 OnLogin Event begin
            // Form1 OnLogin Event end
            //-------------------------------
            if ($is_passed) {
                //-------------------------------
                // Login and password passed
                //-------------------------------
                set_session("UserID", $db->f("USUA_LOGIN"));
                set_session("Nivel", $db->f("CODI_NIVEL"));
                $sPage = get_param("ret_page");
                if (strlen($sPage)) {
                    header("Location: " . $sPage);
                } else {
                    header("Location: busqueda.php");
                }
            } else {
                $sForm1Err = "La identificaci&oacute;n o la palabra clave es incorrecta.";
            }
            //-------------------------------
            // Form1 Login end
            //-------------------------------
            break;
        case "logout":
            //-------------------------------
            // Logout action
            //-------------------------------
            //-------------------------------
            // Form1 Logout begin
            //-------------------------------
            //-------------------------------
            // Form1 OnLogout Event begin
            // Form1 OnLogout Event end
            //-------------------------------
            session_unregister("UserID");
            session_unregister("UserRights");
            if (strlen(get_param("ret_page"))) {
                header("Location:" . $sFileName . "?ret_page=" . urlencode(get_param("ret_page")));
            } else {
                header("Location:" . $sFileName);
            }
            //-------------------------------
            // Form1 Logout end
            //-------------------------------
            break;
    }
}
开发者ID:kractos26,项目名称:orfeo,代码行数:64,代码来源:login.php


示例20: submitUser

 function submitUser($request, $method = 'reg')
 {
     $time = time();
     global $path_site;
     if ($method == 'login') {
         // LOGIN USER
         $un = $request['username'];
         $unlower = strtolower($request['username']);
         $unupper = strtoupper($request['username']);
         $unucfirst = ucfirst($request['username']);
         $unucwords = ucwords($request['username']);
         $password = $request['password'];
         $query = "select id,password,email,zip from user where (username = '{$un}' or username = '{$unlower}' or username = '{$unupper}' or username = '{$unucfirst}' or username = '{$unucwords}') and status='active'";
         $result = mysql_query($query) or die(mysql_error());
         $row = mysql_fetch_row($result);
         if (pw_check($password, $row[1])) {
             // START SESSION
             set_session($row[0], $request['username'], stripslashes($row[2]), $row[3]);
             //return
             return TRUE;
         } else {
             return FALSE;
         }
     } else {
         if ($method == 'forgot') {
             // LOGIN USER
             $email = strtolower($request['user_email']);
             $tempPassword = uniqid(rand(0, 9999999));
             $query = "update user set password='" . pw_encode($tempPassword) . "' where email='" . $email . "' and status <> 'deleted'";
             if ($result = mysql_query($query)) {
                 // SEND EMAIL, RETURN TRUE CHANGE IN PRODUCTION - THE HTTP HOST BELOW NEEDS TO BE UPDATED
                 $query = "select username from user where email='" . $email . "' and status <> 'deleted'";
                 $result = mysql_query($query) or die(mysql_error());
                 $row = mysql_fetch_row($result);
                 // SEND AN EMAIL TO USER
                 $to = stripslashes($row[0]) . '<' . $email . '>';
                 $from = EMAIL_FORGOT_FROM;
                 $subject = EMAIL_FORGOT_SUBJECT;
                 // CALL CONTENT AND REPLACE TAGS INSIDE
                 $template = $path_site . EMAIL_FORGOT_TEMPLATE;
                 $returnOutput = new main_output($template);
                 // replace tags from template
                 @$returnOutput->replace_tags(array('subject' => EMAIL_BUSINESS_REGISTER_SUBJECT, 'username' => stripslashes($row[0]), 'site_name' => SITE_NAME, 'site_title' => SITE_TITLE, 'temppassword' => $tempPassword, 'path_site' => SITE_BASEURL_SECURE));
                 // Call the output
                 $body = $returnOutput->output;
                 // CALL SEND EMAIL
                 // send_email($to,$subject,$body,$from);
                 send_email($email, $subject, $body);
                 //return
                 return TRUE;
             } else {
                 //echo $query;
                 return FALSE;
             }
         } else {
             if ($method == 'verify') {
                 // LOGIN USER
                 mysql_query("update user set status='active' where secToken='" . $request['verify'] . "'") or die(mysql_error());
                 $result = mysql_query("select id,username,email,zip from user where secToken='" . $request['verify'] . "'") or die(mysql_error());
                 $row = mysql_fetch_row($result);
                 set_session($row[0], stripslashes($row[1]), stripslashes($row[2]), $row[3]);
                 return TRUE;
             } else {
                 if ($method == 'profile') {
                     $userid = $_SESSION['user']['id'];
                     $flag_nl = 0;
                     if (isset($request['newsletter']) and ($request['newsletter'] == 'on' or $request['newsletter'] == 1)) {
                         $flag_nl = 1;
                     }
                     // check if old password was selected.
                     $query_pw = NULL;
                     if (isset($request['user_pass2']) and !empty($request['user_pass2'])) {
                         $query_pw = "password = '" . pw_encode($request['user_pass2']) . "', ";
                     }
                     $query = "\n\t\t\t\tupdate user set\n\t\t\t\t\temail = '" . addslashes(strtolower($request['user_email'])) . "',\n\t\t\t\t\tusername = '" . addslashes($request['user_name']) . "',\n\t\t\t\t\tfirstName = '" . addslashes($request['user_fname']) . "',\n\t\t\t\t\tmi = '" . addslashes($request['user_mi']) . "',\n\t\t\t\t\tlastName = '" . addslashes($request['user_lname']) . "',\n\t\t\t\t\taddr1 = '" . addslashes($request['user_addr1']) . "',\n\t\t\t\t\taddr2 = '" . addslashes($request['user_addr2']) . "',\n\t\t\t\t\tcity = '" . addslashes($request['user_city']) . "',\n\t\t\t\t\tstate = '" . addslashes($request['user_state']) . "',\n\t\t\t\t\tzip = '" . addslashes($request['user_zc1']) . addslashes($request['user_zc2']) . "',\n\t\t\t\t\tmainPhone = '" . addslashes($request['user_phone1'] . $request['user_phone2'] . $request['user_phone3']) . "',\n\t\t\t\t\taltPhone = '" . addslashes($request['user_phone4'] . $request['user_phone5'] . $request['user_phone6']) . "',\t\t\t\t\t\n\t\t\t\t\t" . $query_pw . "\n\t\t\t\t\tflag_nl = '" . $flag_nl . "' \n\t\t\t\tWHERE id = '" . $userid . "'\n\t\t\t";
                     mysql_query($query) or die(mysql_error());
                     return TRUE;
                 } else {
                     if ($method == 'reg') {
                         global $path_site;
                         $flag_agree = 0;
                         // get agree flag
                         if (isset($request['agree']) and ($request['agree'] == 'on' or $request['agree'] == '1')) {
                             $flag_agree = 1;
                         }
                         // INSERT VALUES
                         /*$query = "
                         			insert into user set
                         				username = '" .addslashes($request['user_name']). "',
                         				email = '" .addslashes(strtolower($request['user_email'])). "',
                         				password = '" .pw_encode($request['user_pass']). "',
                         				firstName = '" .addslashes($request['user_fname']). "',
                         				mi = '" .addslashes($request['user_mi']). "',
                         				lastName = '" .addslashes($request['user_lname']). "',
                         				addr1 = '" .addslashes($request['user_addr1']). "',
                         				addr2 = '" .addslashes($request['user_addr2']). "',
                         				city = '" .addslashes($request['user_city']). "',
                         				state = '" .addslashes($request['user_state']). "',
                         				zip = '" .addslashes($request['user_zc1']).addslashes($request['user_zc2']). "',
                         				mainPhone = '" .addslashes($request['user_phone1'].$request['user_phone2'].$request['user_phone3']). "',
//.........这里部分代码省略.........
开发者ID:Jonathonbyrd,项目名称:5TwentyCMS,代码行数:101,代码来源:profile.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP set_single_sysctl函数代码示例发布时间:2022-05-15
下一篇:
PHP set_send_count函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap