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


PHP cookie::setCookie方法代码示例

本文整理汇总了PHP中cookie::setCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP cookie::setCookie方法的具体用法?PHP cookie::setCookie怎么用?PHP cookie::setCookie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cookie的用法示例。


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

示例1: date

}else{ */
if (isset($_REQUEST['cust_id']) && isset($_REQUEST['subs_id']) && isset($_REQUEST['ref'])) {
    $db->db_connect();
    $cust_id = $_REQUEST['cust_id'];
    $url = '/customers/' . $cust_id . '/subscriptions.xml';
    $result = $connector->sendRequest($url, $format = 'xml', $method = 'GET', $data = '');
    if ($result->code == 200) {
        $objxml = simplexml_load_string($result->response);
        $state = $objxml->subscription->state;
        $expiry = $objxml->subscription->current_period_ends_at;
        $subs_id = $_REQUEST['subs_id'];
        $fname = $objxml->subscription->customer->first_name;
        $lname = $objxml->subscription->customer->last_name;
        $email = $objxml->subscription->customer->email;
        $productId = $objxml->subscription->product->id;
        $cust_id = $_REQUEST['cust_id'];
        $date = date('Y-m-d h:i:s');
        $gId = $_REQUEST['ref'];
        $_SESSION['newcreated'] = time();
        mysql_query("UPDATE businessUserGroup SET chargify_cust_id ={$cust_id}, subscription_id ={$subs_id} , email='{$email}',state='{$state}',addLoc=0,productId={$productId},expiration='{$expiry}' WHERE gId={$gId}");
        $result = mysql_query("SELECT id FROM businessUsers WHERE userGroupId={$gId} AND permission = 0") or die(mysql_error());
        $row = mysql_fetch_object($result);
        $cookie = new cookie();
        $cookie->setCookie($row->id);
        $db->db_disconnect();
        header("Location: index.html");
    } else {
        die('internal server error');
    }
}
//}
开发者ID:Tripbull,项目名称:newrepo,代码行数:31,代码来源:track.php

示例2: date

 case 'signup':
     include_once 'class/class.cookie.php';
     $fname = mysql_real_escape_string($_REQUEST['fname']);
     $lname = mysql_real_escape_string($_REQUEST['lname']);
     $email = mysql_real_escape_string($_REQUEST['email']);
     $pwd = mysql_real_escape_string($_REQUEST['pwd']);
     $date = date('Y-m-d H:i:s');
     $plan = $connect->liteID;
     $result = mysql_query("INSERT INTO businessUserGroup SET productId=" . $plan . ", email='{$email}',state='active',addLoc=0,created='{$date}',type=0,expiration=''") or die(mysql_error());
     $groupId = mysql_insert_id();
     echo json_encode(array('type' => $plan, 'groupId' => $groupId));
     $sql = "INSERT INTO businessUsers SET userGroupId={$groupId},fname='{$fname}',lname='{$lname}',pwd='" . $pwd . "',email='{$email}'";
     mysql_query($sql) or die(mysql_error());
     $lastid = mysql_insert_id();
     $cookie = new cookie();
     $cookie->setCookie($lastid);
     $time = time();
     $name = $fname . ' ' . $lname;
     //optional
     $join_date = round(time() / 60) * 60;
     mysql_query('INSERT INTO subscribers (userID, email, name, custom_fields, list, timestamp, join_date) VALUES (1, "' . $email . '", "' . $name . '", "", 2, ' . $time . ', ' . $join_date . ')');
     break;
 case 'wizardsetupdone':
     $placeid = $_REQUEST['placeId'];
     $sql = "UPDATE  `businessList` SET  `setup` =  1 WHERE  `id` = {$placeid}";
     mysql_query($sql) or die(mysql_error());
     break;
 case 'texthour':
     $placeId = $_REQUEST['placeId'];
     $val = $_REQUEST['val'];
     $result = mysql_query("SELECT id FROM businessOpeningHours WHERE openingPlaceId = {$placeId}");
开发者ID:Tripbull,项目名称:newrepo,代码行数:31,代码来源:setData.php


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