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


PHP tep_session_id函数代码示例

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


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

示例1: tep_update_whos_online

function tep_update_whos_online()
{
    global $customer_id;
    if (tep_session_is_registered('customer_id')) {
        $wo_customer_id = $customer_id;
        $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
        $customer = tep_db_fetch_array($customer_query);
        $wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
    } else {
        $wo_customer_id = '';
        $wo_full_name = 'Guest';
    }
    $wo_session_id = tep_session_id();
    $wo_ip_address = tep_get_ip_address();
    $wo_last_page_url = tep_db_prepare_input(getenv('REQUEST_URI'));
    $current_time = time();
    $xx_mins_ago = $current_time - 900;
    // remove entries that have expired
    tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
    $stored_customer_query = tep_db_query("select session_id from " . TABLE_WHOS_ONLINE . " where session_id = '" . tep_db_input($wo_session_id) . "' limit 1");
    if (tep_db_num_rows($stored_customer_query) > 0) {
        tep_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int) $wo_customer_id . "', full_name = '" . tep_db_input($wo_full_name) . "', ip_address = '" . tep_db_input($wo_ip_address) . "', time_last_click = '" . tep_db_input($current_time) . "', last_page_url = '" . tep_db_input($wo_last_page_url) . "' where session_id = '" . tep_db_input($wo_session_id) . "'");
    } else {
        tep_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values ('" . (int) $wo_customer_id . "', '" . tep_db_input($wo_full_name) . "', '" . tep_db_input($wo_session_id) . "', '" . tep_db_input($wo_ip_address) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($wo_last_page_url) . "')");
    }
}
开发者ID:othreed,项目名称:osCommerce-234-bootstrap-wADDONS,代码行数:26,代码来源:whos_online.php

示例2: get_email_footer

 function get_email_footer()
 {
     global $order, $customer_id, $currencies;
     $email_footer = '';
     if (is_object($order) && $this->enabled) {
         $this->update_status();
         $ot_total_value = 0;
         reset($order->totals);
         while (list(, $ot) = each($order->totals)) {
             if ($ot['class'] == 'ot_total') {
                 $ot_total_value = $ot['value'];
                 break;
             }
         }
         $ot_total_value = round($ot_total_value * $currencies->get_value(MODULE_PAYMENT_INTERKASSA_DEFAULT_CURRENCY), $currencies->get_decimal_places(MODULE_PAYMENT_INTERKASSA_DEFAULT_CURRENCY));
         $ot_total_value = str_replace(',', '.', $ot_total_value);
         $insert_id = $order->info['id'];
         $sign = md5(MODULE_PAYMENT_INTERKASSA_LOGIN . ':' . $ot_total_value . ':' . $insert_id . ':' . '' . ':' . tep_session_id() . ':' . MODULE_PAYMENT_INTERKASSA_PASSWORD);
         $payment_url = (MODULE_PAYMENT_INTERKASSA_MODE == 'Test' ? 'https://test.interkassa.com/lib/payment.php' : 'https://interkassa.com/lib/payment.php') . '?ik_shop_id=' . urlencode(MODULE_PAYMENT_INTERKASSA_LOGIN) . '&ik_payment_amount=' . urlencode($ot_total_value) . '&ik_payment_id=' . $insert_id . '&ik_payment_desc=' . urlencode('Оплата заказа #' . $insert_id . ' в магазине ' . STORE_NAME) . '&ik_baggage_fields=' . tep_session_id() . '&ik_sign_hash=' . urlencode($sign);
         if (basename(SCRIPT_FILENAME) == FILENAME_ACCOUNT_HISTORY_INFO) {
             $email_footer = str_replace('>[link]<', '>' . substr($payment_url, 0, 33) . '...' . substr($payment_url, -10) . '<', MODULE_PAYMENT_INTERKASSA_TEXT_EMAIL_FOOTER);
             $email_footer = str_replace('[link]', $payment_url, $email_footer);
             //		  $email_footer = str_replace(' target="_blank"', '', $email_footer);
         } else {
             $email_footer = str_replace('[link]', $payment_url, MODULE_PAYMENT_INTERKASSA_TEXT_EMAIL_FOOTER);
         }
     }
     return $email_footer;
 }
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:29,代码来源:interkassa.php

示例3: get_current_page

 function get_current_page()
 {
     global $HTTP_GET_VARS, $HTTP_POST_VARS, $request_type;
     $get_vars = array();
     if (tep_not_null(REQUEST_URI)) {
         if (strpos(REQUEST_URI, '?')) {
             $current_page = PHP_SELF;
             //		  if (substr($current_page, 0, strlen(DIR_WS_CATALOG))==DIR_WS_CATALOG) $current_page = substr($current_page, strlen(DIR_WS_CATALOG));
             $qstring = substr(REQUEST_URI, strpos(REQUEST_URI, '?') + 1);
             $qstring_array = explode('&', str_replace('&amp;', '&', $qstring));
             reset($qstring_array);
             while (list(, $get_var) = each($qstring_array)) {
                 list($var_name, $var_value) = explode('=', $get_var);
                 if (!in_array($var_name, array('x', 'y'))) {
                     $get_vars[$var_name] = urldecode($var_value);
                 }
             }
         } else {
             $current_page = REQUEST_URI;
             $qstring = '';
         }
     } else {
         $current_page = basename(SCRIPT_FILENAME);
         $get_vars = $HTTP_GET_VARS;
     }
     if (!in_array(tep_session_name(), array_keys($get_vars))) {
         $get_vars[tep_session_name()] = tep_session_id();
     }
     return array('page' => $current_page, 'mode' => $request_type, 'get' => $get_vars, 'post' => $HTTP_POST_VARS, 'real_page' => basename(SCRIPT_FILENAME), 'real_get' => $HTTP_GET_VARS);
 }
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:30,代码来源:navigation_history.php

示例4: get_admin_link

function get_admin_link($page = '', $parameters = '', $add_session_id = true)
{
    global $request_type, $session_started, $SID;
    if (!tep_not_null($page)) {
        $page = PAGE_DEFAULT;
    }
    $link = _HTTP_ADMIN_SITE_ROOT . '/?';
    if (tep_not_null($parameters)) {
        $link .= $page . '&' . tep_output_string($parameters);
        $separator = '&';
    } else {
        $link .= $page;
        $separator = '&';
    }
    while (substr($link, -1) == '&' || substr($link, -1) == '?') {
        $link = substr($link, 0, -1);
    }
    // Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    if ($add_session_id == true && $session_started == true && SESSION_FORCE_COOKIE_USE == 'False') {
        if (tep_not_null($SID)) {
            $_sid = $SID;
        } elseif ($request_type == 'NONSSL' && $connection == 'SSL' && ENABLE_SSL == true || $request_type == 'SSL' && $connection == 'NONSSL') {
            if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
                $_sid = tep_session_name() . '=' . tep_session_id();
            }
        }
    }
    if (isset($_sid)) {
        $link .= $separator . tep_output_string($_sid);
    }
    return $link;
}
开发者ID:rongandat,项目名称:e-global-cya,代码行数:32,代码来源:adminfuncs.php

示例5: osc_href_link

function osc_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true)
{
    if (!tep_not_null($page)) {
        die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
    }
    if ($connection == 'NONSSL') {
        $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
    } elseif ($connection == 'SSL') {
        if (ENABLE_SSL == true) {
            $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
        } else {
            $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
        }
    } else {
        die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
    }
    if (tep_not_null($parameters)) {
        $link .= $page . '?' . tep_output_string($parameters);
        $separator = '&';
    } else {
        $link .= $page;
        $separator = '?';
    }
    while (substr($link, -1) == '&' || substr($link, -1) == '?') {
        $link = substr($link, 0, -1);
    }
    // Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    if ($add_session_id == true && usu::$session_started == true && SESSION_FORCE_COOKIE_USE == 'False') {
        if (tep_not_null(usu::$sid)) {
            $_sid = usu::$sid;
        } elseif (usu::$request_type == 'NONSSL' && $connection == 'SSL' && ENABLE_SSL == true || usu::$request_type == 'SSL' && $connection == 'NONSSL') {
            if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
                $_sid = tep_session_name() . '=' . tep_session_id();
            }
        }
    }
    //commented out SEARCH_ENGINE_FRIENDLY_URLS since removed from oscmax 2.1 sql file
    /*   if ( ( SEARCH_ENGINE_FRIENDLY_URLS == 'true' ) && ( $search_engine_safe == true ) ) {
          while ( strstr( $link, '&&' ) ) $link = str_replace( '&&', '&', $link );
    
          $link = str_replace( '?', '/', $link );
          $link = str_replace( '&', '/', $link );
          $link = str_replace( '=', '/', $link );
    
          $separator = '?';
        }
    */
    if (isset($_sid)) {
        $link .= $separator . tep_output_string($_sid);
    }
    usu::$performance['std_url_array'][] = $link;
    if (defined('SEO_URLS_USE_W3C_VALID') && SEO_URLS_USE_W3C_VALID == 'true') {
        return htmlspecialchars(utf8_encode($link));
    }
    return $link;
}
开发者ID:digideskio,项目名称:oscmax2,代码行数:56,代码来源:Usu_General_Functions.php

示例6: tep_update_whos_online

function tep_update_whos_online()
{
    // WOL 1.6 - Need access to spider_flag and user_agent and moved some assignments up here from below
    global $customer_id, $spider_flag, $user_agent;
    $wo_ip_address = tep_get_ip_address();
    $wo_last_page_url = request_uri();
    $current_time = time();
    $xx_mins_ago = $current_time - 900;
    $wo_session_id = tep_session_id();
    $wo_user_agent = $user_agent;
    // WOL 1.6 EOF
    if ($customer_id > 0) {
        //if (tep_session_is_registered('customer_id')) {
        //$wo_session_id = tep_session_id();
        $wo_customer_id = $customer_id;
        $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
        $customer = tep_db_fetch_array($customer_query);
        $wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
    } else {
        if ($spider_flag) {
            // Bots are customerID = -1
            $wo_customer_id = -1;
            // The Bots name is extracted from the User Agent in the WOE Admin screen
            $wo_full_name = $user_agent;
            // Session IDs are the WOE primary key.  If a Bot doesn't have a session (normally shouldn't),
            //   use the IP Address as unique identifier, otherwise, use the session ID
            if ($wo_session_id == "") {
                $wo_session_id = $wo_ip_address;
            }
        } else {
            // Must be a Guest
            $wo_full_name = 'Guest';
            $wo_customer_id = 0;
        }
        // WOL 1.6 EOF
    }
    // remove entries that have expired
    tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
    $stored_customer_query = tep_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where session_id = '" . tep_db_input($wo_session_id) . "'");
    $stored_customer = tep_db_fetch_array($stored_customer_query);
    if ($stored_customer['count'] > 0) {
        tep_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int) $wo_customer_id . "', full_name = '" . tep_db_input($wo_full_name) . "', ip_address = '" . tep_db_input($wo_ip_address) . "', time_last_click = '" . tep_db_input($current_time) . "', last_page_url = '" . tep_db_input($wo_last_page_url) . "' where session_id = '" . tep_db_input($wo_session_id) . "'");
    } else {
        tep_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url, http_referer, user_agent) values ('" . (int) $wo_customer_id . "', '" . tep_db_input($wo_full_name) . "', '" . tep_db_input($wo_session_id) . "', '" . tep_db_input($wo_ip_address) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($wo_last_page_url) . "', '" . tep_db_input($_SERVER['HTTP_REFERER']) . "', '" . tep_db_input($user_agent) . "')");
    }
}
开发者ID:eosc,项目名称:EosC-2.3,代码行数:46,代码来源:whos_online.php

示例7: display_links

 function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
 {
     global $PHP_SELF;
     if (tep_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     // calculate number of pages needing links
     $num_pages = ceil($query_numrows / $max_rows_per_page);
     $pages_array = array();
     for ($i = 1; $i <= $num_pages; $i++) {
         $pages_array[] = array('id' => $i, 'text' => $i);
     }
     if ($num_pages > 1) {
         $display_links = tep_draw_form('pages', basename($PHP_SELF), '', 'get');
         if ($current_page_number > 1) {
             $display_links .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number - 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_PREV . '</a>&nbsp;&nbsp;';
         } else {
             $display_links .= PREVNEXT_BUTTON_PREV . '&nbsp;&nbsp;';
         }
         $display_links .= sprintf(TEXT_RESULT_PAGE, tep_draw_pull_down_menu($page_name, $pages_array, $current_page_number, 'onChange="this.form.submit();"'), $num_pages);
         if ($current_page_number < $num_pages && $num_pages != 1) {
             $display_links .= '&nbsp;&nbsp;<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number + 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_NEXT . '</a>';
         } else {
             $display_links .= '&nbsp;&nbsp;' . PREVNEXT_BUTTON_NEXT;
         }
         if ($parameters != '') {
             if (substr($parameters, -1) == '&') {
                 $parameters = substr($parameters, 0, -1);
             }
             $pairs = explode('&', $parameters);
             while (list(, $pair) = each($pairs)) {
                 list($key, $value) = explode('=', $pair);
                 $display_links .= tep_draw_hidden_field(rawurldecode($key), rawurldecode($value));
             }
         }
         if (SID) {
             $display_links .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
         }
         $display_links .= '</form>';
     } else {
         $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
     }
     return $display_links;
 }
开发者ID:CristianCCIT,项目名称:shop4office,代码行数:44,代码来源:split_page_results.php

示例8: tep_db_query

    }
}
if (isset($HTTP_GET_VARS['manufacturers_id']) && basename(SCRIPT_FILENAME) != FILENAME_MANUFACTURERS) {
    if (basename(SCRIPT_FILENAME) != FILENAME_ADVANCED_SEARCH && basename(SCRIPT_FILENAME) != FILENAME_ADVANCED_SEARCH_RESULT) {
        $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int) $HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int) DEFAULT_LANGUAGE_ID . "'");
        if (tep_db_num_rows($manufacturers_query) > 0) {
            $manufacturers = tep_db_fetch_array($manufacturers_query);
            $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_MANUFACTURERS, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
        }
    }
}
// if partner is set update partners
if (isset($HTTP_GET_VARS['partner']) && $session_started == true) {
    $partner_info_query = tep_db_query("select partners_id from " . TABLE_PARTNERS . " where partners_login = '" . tep_db_input(tep_db_prepare_input(mb_convert_encoding($HTTP_GET_VARS['partner'], 'CP1251', 'UTF-8'))) . "'");
    if (tep_db_num_rows($partner_info_query) < 1) {
        tep_db_query("insert into " . TABLE_PARTNERS . " (date_added, partners_login, date_of_last_logon, partners_register_type, partners_comission) values (now(), '" . tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['partner'])) . "', now(), 'auto', '" . tep_db_input(str_replace(',', '.', PARTNERS_COMISSION_DEFAULT / 100)) . "')");
        $partners_id = tep_db_insert_id();
    } else {
        $partner_info = tep_db_fetch_array($partner_info_query);
        $partners_id = $partner_info['partners_id'];
    }
    tep_db_query("insert into " . TABLE_PARTNERS_STATISTICS . " (partners_id, date_added, partners_statistics_page, partners_statistics_referer, partners_statistics_ip, partners_statistics_sid) values ('" . (int) $partners_id . "', now(), '" . tep_db_input(tep_db_prepare_input(REQUEST_URI)) . "', '" . tep_db_input(tep_db_prepare_input($_SERVER['HTTP_REFERER'])) . "', '" . tep_db_input(tep_get_ip_address()) . "', '" . tep_db_input(tep_session_id()) . "')");
    @tep_setcookie(str_replace('.', '_', STORE_NAME) . '_partner', $partners_id, time() + 60 * 60 * 24 * 30 * 2, '/');
}
// set which precautions should be checked
define('WARN_INSTALL_EXISTENCE', 'true');
define('WARN_CONFIG_WRITEABLE', 'false');
define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
define('WARN_SESSION_AUTO_START', 'true');
define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
$holiday_products_array = array('pearls' => array('title' => 'Ђ∆емчужинаї вашей библиотеки', 'products' => '152879, 152879, 164742, 166080, 244419, 276036, 307975, 44451, 44455, 45277, 45284, 47537, 524851, 549504, 62377', 'categories' => ''), 'art_albums' => array('title' => 'јльбомы по искусству', 'products' => '151248, 177562, 227545, 275800, 302609, 305304, 305345, 305905, 306189, 308790, 310516, 326703, 332484, 333583, 351876, 355236, 385907, 3870, 3884, 394134, 408614, 416433, 417561, 423783, 43872, 43879, 43982, 45016, 450274, 45040, 45541, 467051, 468197, 473169, 473180, 473181, 473190, 50388, 50445, 512932, 526223, 545250, 62009', 'categories' => ''), 'pets' => array('title' => '¬аши любимые питомцы', 'products' => '11308, 19503, 243569, 392509, 39910, 39913, 439461, 470371, 49446, 49455, 544530', 'categories' => ''), 'children' => array('title' => 'ƒетский Ќовый год', 'products' => '124613, 225298, 25222, 269475, 271673, 272098, 275298, 289242, 293623, 293624, 297554, 297648, 297649, 298433, 298466, 304929, 304930, 305004, 307479, 308927, 309508, 309709, 309709, 309710, 309710, 309712, 309712, 31134, 38982, 39458, 39784, 39784, 39785, 39786, 39787, 39788, 39788, 39790, 39790, 39791, 39791, 39795, 39799, 39998, 39998, 44561, 477244, 480629, 481035, 481036, 481038, 488411, 488412, 488413, 50995, 51056, 512939, 513991, 524395, 524471, 525152, 525425, 528934, 529049, 529050, 529051, 530685, 530726, 530900, 530901, 530902, 530903, 533382, 54117, 54199, 54290, 548651, 550001, 57222, 666515, 671325, 78137, 246321, 301109, 308927, 315131, 40712, 447897, 49131, 533187, 548656', 'categories' => '4946, 4987'), 'adventures' => array('title' => 'ћир путешествий и приключений', 'products' => '102635, 221700, 227545, 313937, 422826, 43947, 43949, 448966, 45471, 455812, 468528, 529778', 'categories' => ''), 'men' => array('title' => 'ѕодарки дл¤ насто¤щих мужчин', 'products' => '43901, 111616, 39944, 98000, 43744, 39961, 106390, 166091, 39954, 245990, 39946, 434611, 127472, 310371, 334410, 411303, 437137, 439455, 467793, 478709, 501918, 501992, 524435, 524436, 524437, 524438, 525963, 54023, 548939, 65757, 90793', 'categories' => ''), 'feast' => array('title' => 'ѕраздничный стол', 'products' => '127377, 127463, 165179, 176134, 178534, 186113, 225259, 238505, 238509, 245601, 306174, 310010, 331002, 334380, 354418, 400956, 419019, 43726, 449824, 450048, 468194, 480992, 499862, 501919, 513356, 513551, 531134, 533353, 544816, 548809, 549123, 549398, 549503, 549863, 57003, 57666, 62235, 667042', 'categories' => ''), 'christmas' => array('title' => '–ождество', 'products' => '16739, 272302, 275543, 40210, 467253, 499757, 512645, 513038, 513046, 528760, 544610, 549263, 289391, 305962, 306345, 307085, 318316, 396525, 433076, 465379, 481098, 499328, 533278', 'categories' => ''), 'souvenirs' => array('title' => '—увениры и при¤тные мелочи', 'products' => '425028, 425065, 425094, 425170, 425171, 425175, 425176, 425177, 425178, 425180, 425181, 425183', 'categories' => '4893, 3406, 3415, 3419, 3429, 4872, 9506'), 'women' => array('title' => '“олько дл¤ женщин', 'products' => '49453, 76750, 102773, 174786, 195937, 241647, 245920, 258642, 267722, 270181, 275127, 306380, 308222, 43745, 448967, 464270, 49453, 500025, 525199, 531137, 532184, 544552, 545236, 549828', 'categories' => ''), 'encyclopedia' => array('title' => 'Ёнциклопедии', 'products' => '164683, 214042, 236812, 39907, 39939, 39940, 39945, 39949, 39953, 39966, 45020, 45378, 462128, 68400', 'categories' => ''));
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:31,代码来源:application_top.php

示例9: tep_session_recreate

function tep_session_recreate()
{
    global $SID;
    if (PHP_VERSION >= 5.1) {
        session_regenerate_id(true);
        if (!empty($SID)) {
            $SID = tep_session_name() . '=' . tep_session_id();
        }
    }
}
开发者ID:wrtcoder,项目名称:mini_isp,代码行数:10,代码来源:sessions.php

示例10: mkdir

        mkdir($categories_cache_dir, 0777);
    }
    $categories_cache_filename = $categories_cache_dir . 'tree_' . $current_category_id . '.html';
    $include_categories_cache_filename = false;
    if (file_exists($categories_cache_filename)) {
        if (date('Y-m-d H:i:s', filemtime($categories_cache_filename)) > $type_info['products_last_modified']) {
            $include_categories_cache_filename = true;
        }
    }
    $box_info_query = tep_db_query("select blocks_name from " . TABLE_BLOCKS . " where blocks_filename = '" . tep_db_input(basename(__FILE__)) . "' and language_id = '" . (int) $languages_id . "'");
    $box_info = tep_db_fetch_array($box_info_query);
    $boxHeading = '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $check_products_types_id) . '">' . $box_info['blocks_name'] . '</a>';
    $boxID = $type_info['products_types_path'];
    if ($include_categories_cache_filename == false) {
        $boxContent = tep_show_category(0, 0, '', $check_products_types_id);
        $boxContent = str_replace('?' . tep_session_name() . '=' . tep_session_id(), '', $boxContent);
        $fp = fopen($categories_cache_filename, 'w');
        fwrite($fp, $boxContent);
        fclose($fp);
    } else {
        $boxContent = '';
        $fp = fopen($categories_cache_filename, 'r');
        while (!feof($fp)) {
            $boxContent .= fgets($fp, 400);
        }
        fclose($fp);
    }
    if (tep_not_null($boxContent)) {
        include DIR_WS_TEMPLATES_BOXES . 'box.php';
    }
}
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:31,代码来源:block_23.php

示例11: order

 $order = new order();
 $params['ACTION'] = 'S';
 $params['CURRENCY'] = $order->info['currency'];
 $params['EMAIL'] = $order->customer['email_address'];
 $params['AMT'] = $paypal_uk_express->format_raw($order->info['total']);
 $params['RETURNURL'] = tep_href_link('ext/modules/payment/paypal/express_uk.php', 'osC_Action=retrieve', 'SSL', true, false);
 $params['CANCELURL'] = tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL', true, false);
 if ($order->content_type == 'virtual') {
     $params['NOSHIPPING'] = '1';
 }
 $post_string = '';
 foreach ($params as $key => $value) {
     $post_string .= $key . '[' . strlen(trim($value)) . ']=' . trim($value) . '&';
 }
 $post_string = substr($post_string, 0, -1);
 $response = $paypal_uk_express->sendTransactionToGateway($api_url, $post_string, array('X-VPS-REQUEST-ID: ' . md5($cartID . tep_session_id() . rand())));
 $response_array = array();
 parse_str($response, $response_array);
 if ($response_array['RESULT'] == '0') {
     tep_redirect($paypal_url . '&token=' . $response_array['TOKEN']);
 } else {
     switch ($response_array['RESULT']) {
         case '1':
         case '26':
             $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_CFG_ERROR;
             break;
         case '1000':
             $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_EXPRESS_DISABLED;
             break;
         default:
             $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_GENERAL;
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:express_uk.php

示例12: tep_hide_session_id

function tep_hide_session_id()
{
    global $session_started, $SID;
    if ($session_started == true && tep_not_null($SID)) {
        return tep_draw_hidden_field(tep_session_name(), tep_session_id());
    }
}
开发者ID:eosc,项目名称:EosC-2.3,代码行数:7,代码来源:html_output.php

示例13: before_process

 function before_process()
 {
     global $HTTP_POST_VARS, $order, $sendto;
     if (isset($HTTP_POST_VARS['cc_owner_firstname']) && !empty($HTTP_POST_VARS['cc_owner_firstname']) && isset($HTTP_POST_VARS['cc_owner_lastname']) && !empty($HTTP_POST_VARS['cc_owner_lastname']) && isset($HTTP_POST_VARS['cc_type']) && isset($this->cc_types[$HTTP_POST_VARS['cc_type']]) && isset($HTTP_POST_VARS['cc_number_nh-dns']) && !empty($HTTP_POST_VARS['cc_number_nh-dns'])) {
         if (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_SERVER == 'Live') {
             $api_url = 'https://payflowpro.verisign.com/transaction';
         } else {
             $api_url = 'https://pilot-payflowpro.verisign.com/transaction';
         }
         $name = explode(' ', $HTTP_POST_VARS['cc_owner'], 2);
         $params = array('USER' => tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_USERNAME) ? MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_USERNAME : MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR, 'VENDOR' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR, 'PARTNER' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PARTNER, 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PASSWORD, 'TENDER' => 'C', 'TRXTYPE' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_METHOD == 'Sale' ? 'S' : 'A', 'AMT' => $this->format_raw($order->info['total']), 'CURRENCY' => $order->info['currency'], 'FIRSTNAME' => $HTTP_POST_VARS['cc_owner_firstname'], 'LASTNAME' => $HTTP_POST_VARS['cc_owner_lastname'], 'STREET' => $order->billing['street_address'], 'CITY' => $order->billing['city'], 'STATE' => tep_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], $order->billing['state']), 'COUNTRY' => $order->billing['country']['iso_code_2'], 'ZIP' => $order->billing['postcode'], 'CLIENTIP' => tep_get_ip_address(), 'EMAIL' => $order->customer['email_address'], 'ACCT' => $HTTP_POST_VARS['cc_number_nh-dns'], 'ACCTTYPE' => $HTTP_POST_VARS['cc_type'], 'CARDSTART' => $HTTP_POST_VARS['cc_starts_month'] . $HTTP_POST_VARS['cc_starts_year'], 'EXPDATE' => $HTTP_POST_VARS['cc_expires_month'] . $HTTP_POST_VARS['cc_expires_year'], 'CVV2' => $HTTP_POST_VARS['cc_cvc_nh-dns'], 'BUTTONSOURCE' => 'osCommerce22_Default_PRO2DP');
         if ($HTTP_POST_VARS['cc_type'] == '9' || $HTTP_POST_VARS['cc_type'] == 'S') {
             $params['CARDISSUE'] = $HTTP_POST_VARS['cc_issue_nh-dns'];
         }
         if (is_numeric($sendto) && $sendto > 0) {
             $params['SHIPTOFIRSTNAME'] = $order->delivery['firstname'];
             $params['SHIPTOLASTNAME'] = $order->delivery['lastname'];
             $params['SHIPTOSTREET'] = $order->delivery['street_address'];
             $params['SHIPTOCITY'] = $order->delivery['city'];
             $params['SHIPTOSTATE'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']);
             $params['SHIPTOCOUNTRY'] = $order->delivery['country']['iso_code_2'];
             $params['SHIPTOZIP'] = $order->delivery['postcode'];
         }
         $post_string = '';
         foreach ($params as $key => $value) {
             $post_string .= $key . '[' . strlen(urlencode(utf8_encode(trim($value)))) . ']=' . urlencode(utf8_encode(trim($value))) . '&';
         }
         $post_string = substr($post_string, 0, -1);
         $response = $this->sendTransactionToGateway($api_url, $post_string, array('X-VPS-REQUEST-ID: ' . md5($cartID . tep_session_id() . rand())));
         $response_array = array();
         parse_str($response, $response_array);
         if ($response_array['RESULT'] != '0') {
             switch ($response_array['RESULT']) {
                 case '1':
                 case '26':
                     $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_CFG_ERROR;
                     break;
                 case '7':
                     $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_ADDRESS;
                     break;
                 case '12':
                     $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_DECLINED;
                     break;
                 case '23':
                 case '24':
                     $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_INVALID_CREDIT_CARD;
                     break;
                 default:
                     $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_GENERAL;
                     break;
             }
             tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, 'error_message=' . urlencode($error_message), 'SSL'));
         }
     } else {
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, 'error_message=' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_ALL_FIELDS_REQUIRED, 'SSL'));
     }
 }
开发者ID:osc2nuke,项目名称:demobts,代码行数:57,代码来源:paypal_pro_payflow_dp.php

示例14: process_button

 function process_button()
 {
     global $customer_id, $order, $currency, $cartID;
     $process_button_string = '';
     $params = array('VPSProtocol' => '2.23', 'ReferrerID' => 'C74D7B82-E9EB-4FBD-93DB-76F0F551C802', 'Vendor' => substr(MODULE_PAYMENT_SAGE_PAY_FORM_VENDOR_LOGIN_NAME, 0, 15));
     if (MODULE_PAYMENT_SAGE_PAY_FORM_TRANSACTION_METHOD == 'Payment') {
         $params['TxType'] = 'PAYMENT';
     } elseif (MODULE_PAYMENT_SAGE_PAY_FORM_TRANSACTION_METHOD == 'Deferred') {
         $params['TxType'] = 'DEFERRED';
     } else {
         $params['TxType'] = 'AUTHENTICATE';
     }
     $crypt = array('VendorTxCode' => substr(date('YmdHis') . '-' . $customer_id . '-' . $cartID, 0, 40), 'Amount' => $this->format_raw($order->info['total']), 'Currency' => $currency, 'Description' => substr(STORE_NAME, 0, 100), 'SuccessURL' => tep_href_link(FILENAME_CHECKOUT_PROCESS, tep_session_name() . '=' . tep_session_id(), 'SSL', false), 'FailureURL' => tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&' . tep_session_name() . '=' . tep_session_id(), 'SSL', false), 'CustomerName' => substr($order->billing['firstname'] . ' ' . $order->billing['lastname'], 0, 100), 'CustomerEMail' => substr($order->customer['email_address'], 0, 255), 'BillingSurname' => substr($order->billing['lastname'], 0, 20), 'BillingFirstnames' => substr($order->billing['firstname'], 0, 20), 'BillingAddress1' => substr($order->billing['street_address'], 0, 100), 'BillingCity' => substr($order->billing['city'], 0, 40), 'BillingPostCode' => substr($order->billing['postcode'], 0, 10), 'BillingCountry' => $order->billing['country']['iso_code_2']);
     if ($crypt['BillingCountry'] == 'US') {
         $crypt['BillingState'] = tep_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], '');
     }
     $crypt['BillingPhone'] = substr($order->customer['telephone'], 0, 20);
     $crypt['DeliverySurname'] = substr($order->delivery['lastname'], 0, 20);
     $crypt['DeliveryFirstnames'] = substr($order->delivery['firstname'], 0, 20);
     $crypt['DeliveryAddress1'] = substr($order->delivery['street_address'], 0, 100);
     $crypt['DeliveryCity'] = substr($order->delivery['city'], 0, 40);
     $crypt['DeliveryPostCode'] = substr($order->delivery['postcode'], 0, 10);
     $crypt['DeliveryCountry'] = $order->delivery['country']['iso_code_2'];
     if ($crypt['DeliveryCountry'] == 'US') {
         $crypt['DeliveryState'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], '');
     }
     if (tep_not_null(MODULE_PAYMENT_SAGE_PAY_FORM_VENDOR_EMAIL)) {
         $crypt['VendorEMail'] = substr(MODULE_PAYMENT_SAGE_PAY_FORM_VENDOR_EMAIL, 0, 255);
     }
     switch (MODULE_PAYMENT_SAGE_PAY_FORM_SEND_EMAIL) {
         case 'No One':
             $crypt['SendEMail'] = 0;
             break;
         case 'Customer and Vendor':
             $crypt['SendEMail'] = 1;
             break;
         case 'Vendor Only':
             $crypt['SendEMail'] = 2;
             break;
     }
     if (tep_not_null(MODULE_PAYMENT_SAGE_PAY_FORM_CUSTOMER_EMAIL_MESSAGE)) {
         $crypt['eMailMessage'] = substr(MODULE_PAYMENT_SAGE_PAY_FORM_CUSTOMER_EMAIL_MESSAGE, 0, 7500);
     }
     $contents = array();
     foreach ($order->products as $product) {
         $product_name = $product['name'];
         if (isset($product['attributes'])) {
             foreach ($product['attributes'] as $att) {
                 $product_name .= '; ' . $att['option'] . '=' . $att['value'];
             }
         }
         $contents[] = str_replace(array(':', "\n", "\r", '&'), '', $product_name) . ':' . $product['qty'] . ':' . $this->format_raw($product['final_price']) . ':' . $this->format_raw($product['tax'] / 100 * $product['final_price']) . ':' . $this->format_raw($product['tax'] / 100 * $product['final_price'] + $product['final_price']) . ':' . $this->format_raw(($product['tax'] / 100 * $product['final_price'] + $product['final_price']) * $product['qty']);
     }
     foreach ($this->getOrderTotalsSummary() as $ot) {
         $contents[] = str_replace(array(':', "\n", "\r", '&'), '', strip_tags($ot['title'])) . ':---:---:---:---:' . $this->format_raw($ot['value']);
     }
     $crypt['Basket'] = substr(sizeof($contents) . ':' . implode(':', $contents), 0, 7500);
     $crypt['Apply3DSecure'] = '0';
     $crypt_string = '';
     foreach ($crypt as $key => $value) {
         $crypt_string .= $key . '=' . trim($value) . '&';
     }
     $crypt_string = substr($crypt_string, 0, -1);
     $params['Crypt'] = base64_encode($this->simpleXor($crypt_string, MODULE_PAYMENT_SAGE_PAY_FORM_ENCRYPTION_PASSWORD));
     foreach ($params as $key => $value) {
         $process_button_string .= tep_draw_hidden_field($key, $value);
     }
     return $process_button_string;
 }
开发者ID:osc2nuke,项目名称:demobts,代码行数:69,代码来源:sage_pay_form.php

示例15: process_button

 function process_button($transactionID = 0, $key = "")
 {
     global $order;
     $my_currency = MODULE_PAYMENT_IRIDIUM_CURRENCY;
     $amount = number_format($order->info['total'], 2, '.', '') * 100;
     $ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
     $process_button_string = tep_draw_hidden_field('MerchantID', MODULE_PAYMENT_IRIDIUM_MERCHANTID) . tep_draw_hidden_field('Password', MODULE_PAYMENT_IRIDIUM_PASSWORD) . tep_draw_hidden_field('PaymentProcessorDomain', MODULE_PAYMENT_IRIDIUM_GATEWAY) . tep_draw_hidden_field('PaymentProcessorPort', MODULE_PAYMENT_IRIDIUM_GATEWAY_PORT) . tep_draw_hidden_field('Amount', $amount) . tep_draw_hidden_field('CardName', $_POST['CardName']) . tep_draw_hidden_field('CardNumber', $_POST['CardNumber']) . tep_draw_hidden_field('IssueNumber', $_POST['IssueNumber']) . tep_draw_hidden_field('CV2', $_POST['CV2']) . tep_draw_hidden_field('CurrencyISOCode', $this->get_CurrentCurrency()) . tep_draw_hidden_field('transactionID', $transactionID) . tep_draw_hidden_field('sess_id', tep_session_id()) . tep_draw_hidden_field('ExpiryDateMonth', $_POST['ExpiryDateMonth']) . tep_draw_hidden_field('ExpiryDateYear', $_POST['ExpiryDateYear']) . tep_draw_hidden_field('StartDateMonth', $_POST['StartDateMonth']) . tep_draw_hidden_field('StartDateYear', $_POST['StartDateYear']) . tep_draw_hidden_field('OrderID', $transactionID) . tep_draw_hidden_field('Address1', $_POST['Addr1']) . tep_draw_hidden_field('City', $_POST['City']) . tep_draw_hidden_field('State', $_POST['State']) . tep_draw_hidden_field('PostCode', $_POST['PostCode']) . tep_draw_hidden_field('CountryISOCode', $_POST['Country']) . tep_draw_hidden_field('EmailID', $order->billing['email'] ? $order->billing['email'] : ADMIN_EMAIL) . tep_draw_hidden_field('Phone', $_POST['Telephone']) . tep_draw_hidden_field('IPAddress', $ip) . tep_draw_hidden_field('transactionID', $transactionID) . tep_draw_hidden_field('key', $key) . tep_draw_hidden_field('sess_id', tep_session_id()) . tep_draw_hidden_field('return_url', tep_href_link("userinfo.php", '', 'SSL'));
     //tep_draw_hidden_field('cancel_url', tep_href_link("checkout_payment.php", '', 'SSL'));
     //tep_draw_hidden_field('CountryISOCode', $order->billing['country']);
     $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
     return $process_button_string;
 }
开发者ID:saydulk,项目名称:a2billing,代码行数:12,代码来源:iridium.php


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