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


PHP osc_redirect函数代码示例

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


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

示例1: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $requested_product = null;
     if (count($_GET) > 2) {
         $requested_product = basename(key(array_slice($_GET, 2, 1, true)));
         if ($requested_product == 'Add') {
             unset($requested_product);
             if (count($_GET) > 3) {
                 $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (Product::checkEntry($requested_product)) {
             $OSCOM_Product = new Product($requested_product);
             if ($OSCOM_Product->isTypeActionAllowed('AddToShoppingCart')) {
                 if ($OSCOM_Product->hasVariants()) {
                     if (isset($_POST['variants']) && is_array($_POST['variants']) && !empty($_POST['variants'])) {
                         if ($OSCOM_Product->variantExists($_POST['variants'])) {
                             $OSCOM_ShoppingCart->add($OSCOM_Product->getProductVariantID($_POST['variants']));
                         } else {
                             osc_redirect(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword()));
                         }
                     } else {
                         osc_redirect(OSCOM::getLink(null, 'Products', $OSCOM_Product->getKeyword()));
                     }
                 } else {
                     $OSCOM_ShoppingCart->add($OSCOM_Product->getID());
                 }
             }
         }
     }
     osc_redirect(OSCOM::getLink(null, 'Cart'));
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:35,代码来源:Add.php

示例2: _process

 function _process()
 {
     global $osC_Database, $messageStack, $osC_Language;
     $data = array();
     $data['url'] = osc_sanitize_string($_POST['url']);
     if (isset($_POST['title']) && !empty($_POST['title'])) {
         $data['title'] = osc_sanitize_string($_POST['title']);
     } else {
         $messageStack->add('guestbook', $osC_Language->get('field_guestbook_title_error'));
     }
     if (isset($_POST['email']) && !empty($_POST['email']) && osc_validate_email_address($_POST['email'])) {
         $data['email'] = $_POST['email'];
     } else {
         $messageStack->add('guestbook', $osC_Language->get('field_guestbook_email_error'));
     }
     if (isset($_POST['content']) && !empty($_POST['content'])) {
         $data['content'] = osc_sanitize_string($_POST['content']);
     } else {
         $messageStack->add('guestbook', $osC_Language->get('field_guestbook_content_error'));
     }
     if ($_POST['verify_code'] != $_SESSION['verify_code']) {
         $messageStack->add('guestbook', $osC_Language->get('field_guestbook_verify_code_error'));
     }
     if ($messageStack->size('guestbook') === 0) {
         if (toC_Guestbook::saveEntry($data)) {
             $messageStack->add_session('guestbook', $osC_Language->get('success_guestbook_saved'), 'success');
         }
         osc_redirect(osc_href_link(FILENAME_INFO, 'guestbook'));
     }
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:30,代码来源:guestbook.php

示例3: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_PaymentModule = Registry::get('PaymentModule');
     $OSCOM_PaymentModule->process();
     osc_redirect(OSCOM::getLink(null, null, 'Success', 'SSL'));
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:7,代码来源:Process.php

示例4: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $data = array();
     if (DISPLAY_PRIVACY_CONDITIONS == '1') {
         if (isset($_POST['privacy_conditions']) === false || isset($_POST['privacy_conditions']) && $_POST['privacy_conditions'] != '1') {
             $OSCOM_MessageStack->add('Create', OSCOM::getDef('error_privacy_statement_not_accepted'));
         }
     }
     if (ACCOUNT_GENDER >= 0) {
         if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) {
             $data['gender'] = $_POST['gender'];
         } else {
             $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_gender_error'));
         }
     }
     if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) {
         $data['firstname'] = $_POST['firstname'];
     } else {
         $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_first_name_error'), ACCOUNT_FIRST_NAME));
     }
     if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) {
         $data['lastname'] = $_POST['lastname'];
     } else {
         $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_last_name_error'), ACCOUNT_LAST_NAME));
     }
     if (ACCOUNT_DATE_OF_BIRTH == '1') {
         if (isset($_POST['dob_days']) && isset($_POST['dob_months']) && isset($_POST['dob_years']) && checkdate($_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years'])) {
             $data['dob'] = mktime(0, 0, 0, $_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years']);
         } else {
             $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_date_of_birth_error'));
         }
     }
     if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) {
         if (osc_validate_email_address($_POST['email_address'])) {
             if (Account::checkEntry($_POST['email_address']) === false) {
                 $data['email_address'] = $_POST['email_address'];
             } else {
                 $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_email_address_exists_error'));
             }
         } else {
             $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_email_address_check_error'));
         }
     } else {
         $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
     }
     if (isset($_POST['password']) === false || isset($_POST['password']) && strlen(trim($_POST['password'])) < ACCOUNT_PASSWORD) {
         $OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_password_error'), ACCOUNT_PASSWORD));
     } elseif (isset($_POST['confirmation']) === false || isset($_POST['confirmation']) && trim($_POST['password']) != trim($_POST['confirmation'])) {
         $OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_password_mismatch_with_confirmation'));
     } else {
         $data['password'] = $_POST['password'];
     }
     if ($OSCOM_MessageStack->size('Create') === 0) {
         if (Account::createEntry($data)) {
             $OSCOM_MessageStack->add('Create', OSCOM::getDef('success_account_updated'), 'success');
         }
         osc_redirect(OSCOM::getLink(null, null, 'Create&Success', 'SSL'));
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:60,代码来源:Process.php

示例5: _process

 function _process()
 {
     global $osC_Language, $osC_MessageStack, $osC_Product;
     if (empty($_POST['from_name'])) {
         $osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_customers_name_empty'));
     }
     if (!osc_validate_email_address($_POST['from_email_address'])) {
         $osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_customers_email_address'));
     }
     if (empty($_POST['to_name'])) {
         $osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_friends_name_empty'));
     }
     if (!osc_validate_email_address($_POST['to_email_address'])) {
         $osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_friends_email_address'));
     }
     if ($osC_MessageStack->size('tell_a_friend') < 1) {
         $email_subject = sprintf($osC_Language->get('email_tell_a_friend_subject'), osc_sanitize_string($_POST['from_name']), STORE_NAME);
         $email_body = sprintf($osC_Language->get('email_tell_a_friend_intro'), osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['from_name']), $osC_Product->getTitle(), STORE_NAME) . "\n\n";
         if (!empty($_POST['message'])) {
             $email_body .= osc_sanitize_string($_POST['message']) . "\n\n";
         }
         $email_body .= sprintf($osC_Language->get('email_tell_a_friend_link'), osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf($osC_Language->get('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
         osc_email(osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, osc_sanitize_string($_POST['from_name']), osc_sanitize_string($_POST['from_email_address']));
         $osC_MessageStack->add('header', sprintf($osC_Language->get('success_tell_a_friend_email_sent'), $osC_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
         osc_redirect(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID()));
     }
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:27,代码来源:tell_a_friend.php

示例6: execute

 function execute()
 {
     global $osC_Database, $osC_Session, $osC_NavigationHistory, $osC_Customer;
     if (!$osC_Customer->isLoggedOn()) {
         $osC_NavigationHistory->setSnapshot();
         osc_redirect(osc_href_link(FILENAME_ACCOUNT, 'login', 'SSL'));
         return false;
     }
     $id = false;
     foreach ($_GET as $key => $value) {
         if ((ereg('^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$', $key) || ereg('^[a-zA-Z0-9 -_]*$', $key)) && $key != $osC_Session->getName()) {
             $id = $key;
         }
         break;
     }
     if ($id !== false && osC_Product::checkEntry($id)) {
         $osC_Product = new osC_Product($id);
         $Qcheck = $osC_Database->query('select products_id from :table_products_notifications where customers_id = :customers_id and products_id = :products_id limit 1');
         $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
         $Qcheck->bindInt(':customers_id', $osC_Customer->getID());
         $Qcheck->bindInt(':products_id', $osC_Product->getID());
         $Qcheck->execute();
         if ($Qcheck->numberOfRows() > 0) {
             $Qn = $osC_Database->query('delete from :table_products_notifications where customers_id = :customers_id and products_id = :products_id');
             $Qn->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
             $Qn->bindInt(':customers_id', $osC_Customer->getID());
             $Qn->bindInt(':products_id', $osC_Product->getID());
             $Qn->execute();
         }
     }
     osc_redirect(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action'))));
 }
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:32,代码来源:notify_remove.php

示例7: _save_orders_returns

 function _save_orders_returns()
 {
     global $messageStack, $osC_Database, $osC_Language, $osC_Customer;
     $error = false;
     $products = array();
     if (isset($_POST['return_items']) && !empty($_POST['return_items'])) {
         foreach ($_POST['return_items'] as $orders_products_id => $on) {
             if (isset($_POST['quantity'][$orders_products_id]) && $_POST['quantity'][$orders_products_id] > 0) {
                 $products[$orders_products_id] = $_POST['quantity'][$orders_products_id];
             } else {
                 $messageStack->add($this->_module, sprintf($osC_Language->get('error_quantity_for_return_product'), $_POST['products_name'][$orders_products_id]));
             }
         }
     }
     if (sizeof($products) == 0) {
         $messageStack->add($this->_module, $osC_Language->get('error_return_items_empty'));
     }
     if (isset($_POST['comments']) && empty($_POST['comments'])) {
         $messageStack->add($this->_module, $osC_Language->get('error_return_comments_empty'));
     }
     if ($messageStack->size($this->_module) === 0) {
         if (toC_Order_Return::saveReturnRequest($_GET['orders_id'], $products, $_POST['comments'])) {
             $messageStack->add_session($this->_module, $osC_Language->get('success_account_updated'), 'success');
         }
         osc_redirect(osc_href_link(FILENAME_ACCOUNT, 'orders=list_return_requests', 'SSL'));
     }
 }
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:27,代码来源:orders.php

示例8: _process

 function _process()
 {
     global $osC_Database, $osC_Session, $osC_Language, $osC_ShoppingCart, $messageStack, $osC_Customer, $osC_NavigationHistory, $toC_Wishlist;
     if (osC_Account::checkEntry($_POST['email_address'])) {
         if (osC_Account::checkPassword($_POST['password'], $_POST['email_address'])) {
             if (osC_Account::checkStatus($_POST['email_address'])) {
                 if (SERVICE_SESSION_REGENERATE_ID == '1') {
                     $osC_Session->recreate();
                 }
                 $osC_Customer->setCustomerData(osC_Account::getID($_POST['email_address']));
                 $Qupdate = $osC_Database->query('update :table_customers set date_last_logon = :date_last_logon, number_of_logons = number_of_logons+1 where customers_id = :customers_id');
                 $Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS);
                 $Qupdate->bindRaw(':date_last_logon', 'now()');
                 $Qupdate->bindInt(':customers_id', $osC_Customer->getID());
                 $Qupdate->execute();
                 $osC_ShoppingCart->synchronizeWithDatabase();
                 $toC_Wishlist->synchronizeWithDatabase();
                 $osC_NavigationHistory->removeCurrentPage();
                 if ($osC_NavigationHistory->hasSnapshot()) {
                     $osC_NavigationHistory->redirectToSnapshot();
                 } else {
                     osc_redirect(osc_href_link(FILENAME_DEFAULT, null, 'AUTO'));
                 }
             } else {
                 $messageStack->add('login', $osC_Language->get('error_login_status_disabled'));
             }
         } else {
             $messageStack->add('login', $osC_Language->get('error_login_no_match'));
         }
     } else {
         $messageStack->add('login', $osC_Language->get('error_login_no_match'));
     }
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:33,代码来源:login.php

示例9: _process

 function _process()
 {
     global $osC_MessageStack, $osC_Database, $osC_Language;
     $Qcheck = $osC_Database->query('select customers_id, customers_firstname, customers_lastname, customers_gender, customers_email_address, customers_password from :table_customers where customers_email_address = :customers_email_address limit 1');
     $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
     $Qcheck->bindValue(':customers_email_address', $_POST['email_address']);
     $Qcheck->execute();
     if ($Qcheck->numberOfRows() === 1) {
         $password = osc_create_random_string(ACCOUNT_PASSWORD);
         if (osC_Account::savePassword($password, $Qcheck->valueInt('customers_id'))) {
             if (ACCOUNT_GENDER > -1) {
                 if ($data['gender'] == 'm') {
                     $email_text = sprintf($osC_Language->get('email_addressing_gender_male'), $Qcheck->valueProtected('customers_lastname')) . "\n\n";
                 } else {
                     $email_text = sprintf($osC_Language->get('email_addressing_gender_female'), $Qcheck->valueProtected('customers_lastname')) . "\n\n";
                 }
             } else {
                 $email_text = sprintf($osC_Language->get('email_addressing_gender_unknown'), $Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname')) . "\n\n";
             }
             $email_text .= sprintf($osC_Language->get('email_password_reminder_body'), getenv('REMOTE_ADDR'), STORE_NAME, $password, STORE_OWNER_EMAIL_ADDRESS);
             osc_email($Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname'), $Qcheck->valueProtected('customers_email_address'), sprintf($osC_Language->get('email_password_reminder_subject'), STORE_NAME), $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
             $osC_MessageStack->add('login', $osC_Language->get('success_password_forgotten_sent'), 'success');
         }
         osc_redirect(osc_href_link(FILENAME_ACCOUNT, 'login', 'SSL'));
     } else {
         $osC_MessageStack->add('password_forgotten', $osC_Language->get('error_password_forgotten_no_email_address_found'));
     }
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:28,代码来源:password_forgotten.php

示例10: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Shipping = Registry::get('Shipping');
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     if (!empty($_POST['comments'])) {
         $_SESSION['comments'] = osc_sanitize_string($_POST['comments']);
     }
     if ($OSCOM_Shipping->hasQuotes()) {
         if (isset($_POST['shipping_mod_sel']) && strpos($_POST['shipping_mod_sel'], '_')) {
             list($module, $method) = explode('_', $_POST['shipping_mod_sel']);
             if (Registry::exists('Shipping_' . $module) && Registry::get('Shipping_' . $module)->isEnabled()) {
                 $quote = $OSCOM_Shipping->getQuote($_POST['shipping_mod_sel']);
                 if (isset($quote['error'])) {
                     $OSCOM_ShoppingCart->resetShippingMethod();
                 } else {
                     $OSCOM_ShoppingCart->setShippingMethod($quote);
                     osc_redirect(OSCOM::getLink(null, null, null, 'SSL'));
                 }
             } else {
                 $OSCOM_ShoppingCart->resetShippingMethod();
             }
         }
     } else {
         $OSCOM_ShoppingCart->resetShippingMethod();
         osc_redirect(OSCOM::getLink(null, null, null, 'SSL'));
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:27,代码来源:Process.php

示例11: execute

 function execute()
 {
     global $osC_Session, $osC_ShoppingCart;
     $id = false;
     foreach ($_GET as $key => $value) {
         if ((ereg('^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$', $key) || ereg('^[a-zA-Z0-9 -_]*$', $key)) && $key != $osC_Session->getName()) {
             $id = $key;
         }
         break;
     }
     if ($id !== false && osC_Product::checkEntry($id)) {
         $osC_Product = new osC_Product($id);
         $product_id = $osC_Product->getID();
         //gift certificate use timestamp as variant
         if ($osC_Product->isGiftCertificate()) {
             $product_id .= '#' . $_GET['variants'];
         } else {
             if (isset($_GET['variants']) && ereg('^([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*$', $_GET['variants'])) {
                 $product_id .= '#' . $_GET['variants'];
             }
         }
         $osC_ShoppingCart->remove($product_id);
     }
     osc_redirect(osc_href_link(FILENAME_CHECKOUT));
 }
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:25,代码来源:cart_remove.php

示例12: start

 /**
  * Verify an existing session ID and create or resume the session if the existing session ID is valid
  *
  * @access public
  * @return boolean
  */
 public function start()
 {
     if ($this->_life_time > 0) {
         ini_set('session.gc_maxlifetime', $this->_life_time);
     } else {
         $this->_life_time = ini_get('session.gc_maxlifetime');
     }
     session_set_cookie_params(0, OSCOM::getRequestType() == 'NONSSL' ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH, OSCOM::getRequestType() == 'NONSSL' ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);
     $sane_session_id = true;
     if (isset($_GET[$this->_name]) && (empty($_GET[$this->_name]) || !ctype_alnum($_GET[$this->_name]))) {
         $sane_session_id = false;
     } elseif (isset($_POST[$this->_name]) && (empty($_POST[$this->_name]) || !ctype_alnum($_POST[$this->_name]))) {
         $sane_session_id = false;
     } elseif (isset($_COOKIE[$this->_name]) && (empty($_COOKIE[$this->_name]) || !ctype_alnum($_COOKIE[$this->_name]))) {
         $sane_session_id = false;
         setcookie($this->_name, '', time() - 42000, $this->getCookieParameters('path'), $this->getCookieParameters('domain'));
     }
     if ($sane_session_id === false) {
         osc_redirect(OSCOM::getLink(null, OSCOM::getDefaultSiteApplication(), null, 'NONSSL', false));
     } else {
         if (session_start()) {
             register_shutdown_function(array($this, 'close'));
             $this->_is_started = true;
             $this->_id = session_id();
             return true;
         }
     }
     return false;
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:35,代码来源:SessionAbstract.php

示例13: osC_Checkout_Process

 function osC_Checkout_Process()
 {
     global $osC_Session, $osC_ShoppingCart, $osC_Customer, $osC_NavigationHistory, $osC_Payment;
     if ($osC_Customer->isLoggedOn() === false) {
         $osC_NavigationHistory->setSnapshot();
         osc_redirect(osc_href_link(FILENAME_ACCOUNT, 'login', 'SSL'));
     }
     if ($osC_ShoppingCart->hasContents() === false) {
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, null, 'SSL'));
     }
     // if no shipping method has been selected, redirect the customer to the shipping method selection page
     if ($osC_ShoppingCart->hasShippingMethod() === false && $osC_ShoppingCart->getContentType() != 'virtual') {
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL'));
     }
     // load selected payment module
     include 'includes/classes/payment.php';
     $osC_Payment = new osC_Payment($osC_ShoppingCart->getBillingMethod('id'));
     if ($osC_Payment->hasActive() && $osC_ShoppingCart->hasBillingMethod() === false) {
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'payment', 'SSL'));
     }
     include 'includes/classes/order.php';
     $osC_Payment->process();
     $osC_ShoppingCart->reset(true);
     // unregister session variables used during checkout
     unset($_SESSION['comments']);
     osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'success', 'SSL'));
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:27,代码来源:process.php

示例14: _process

 function _process()
 {
     global $osC_Language, $messageStack, $osC_Product;
     if (empty($_POST['from_name'])) {
         $messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_customers_name_empty'));
     }
     if (!osc_validate_email_address($_POST['from_email_address'])) {
         $messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_customers_email_address'));
     }
     if (empty($_POST['to_name'])) {
         $messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_friends_name_empty'));
     }
     if (!osc_validate_email_address($_POST['to_email_address'])) {
         $messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_friends_email_address'));
     }
     if ($messageStack->size('tell_a_friend') < 1) {
         include 'includes/classes/email_template.php';
         $email_template = toC_Email_Template::getEmailTemplate('tell_a_friend');
         $email_template->setData($_POST['from_name'], $_POST['from_email_address'], $_POST['to_name'], $_POST['to_email_address'], $_POST['message'], $osC_Product->getTitle(), osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID(), 'NONSSL', false, true, true));
         $email_template->buildMessage();
         $email_template->sendEmail();
         $messageStack->add_session('header', sprintf($osC_Language->get('success_tell_a_friend_email_sent'), $osC_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
         osc_redirect(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID()));
     }
 }
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:25,代码来源:tell_a_friend.php

示例15: execute

 function execute()
 {
     global $osC_ShoppingCart;
     if (isset($_POST['products']) && is_array($_POST['products']) && !empty($_POST['products'])) {
         foreach ($_POST['products'] as $product => $quantity) {
             if (!is_numeric($quantity)) {
                 return false;
             }
             $product = explode('#', $product, 2);
             $variants_array = array();
             if (isset($product[1])) {
                 $variants = explode(';', $product[1]);
                 foreach ($variants as $set) {
                     $variant = explode(':', $set);
                     if (is_numeric($variant[0]) && is_numeric($variant[1])) {
                         $variants_array[$variant[0]] = $variant[1];
                     }
                 }
             }
             $osC_Product = new osC_Product($product[0]);
             if ($osC_Product->isGiftCertificate()) {
                 $variants_array = $product[1];
             }
             $osC_ShoppingCart->add($product[0], $variants_array, $quantity, null, 'update');
         }
     }
     osc_redirect(osc_href_link(FILENAME_CHECKOUT));
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:28,代码来源:cart_update.php


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