意外t_catch

问题描述:

意外t_catch在线64意外t_catch

我要做什么?

[10月10日2014年22点09分14秒欧洲/布加勒斯特] PHP解析错误:语法错误,在/home/lagramad/public_html/discounts/system/modules/gateway/mobilpay/cardConfirm.php意外T_CATCH上64行

if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) { 
    if ((isset($_POST['env_key']) && isset($_POST['data']))) { 
     $privateKeyFilePath = $_SERVER['DOCUMENT_ROOT'] . '/system/modules/gateway/mobilpay/certificate/private.key'; 
     $objPmReq = Mobilpay_Payment_Request_Abstract::factoryfromencrypted($_POST['env_key'], $_POST['data'], $privateKeyFilePath); 
     switch ($objPmReq->objPmNotify->action) { 
      case 'confirmed': { 
       $errorMessage = $objPmReq->objPmNotify->getCrc(); 
       break; 
      } 

      case 'confirmed_pending': { 
       $errorMessage = $objPmReq->objPmNotify->getCrc(); 
       break; 
      } 

      case 'paid_pending': { 
       $errorMessage = $objPmReq->objPmNotify->getCrc(); 
       break; 
      } 

      case 'paid': { 
       $errorMessage = $objPmReq->objPmNotify->getCrc(); 
       break; 
      } 

      case 'canceled': { 
       $errorMessage = $objPmReq->objPmNotify->getCrc(); 
       break; 
      } 

      case 'credit': { 
       $errorMessage = $objPmReq->objPmNotify->getCrc(); 
       break; 
      } 

      default: { 
       $errorType = CONFIRM_ERROR_TYPE_PERMANENT; 
       $errorCode = ERROR_CONFIRM_INVALID_ACTION; 
       $errorMessage = 'mobilpay_refference_action paramaters is invalid'; 
       break; 
      } 
     } 
     catch (Exception $e) { line 64 
      $errorType = CONFIRM_ERROR_TYPE_TEMPORARY; 
      $errorCode = $e->getCode(); 
      $errorMessage = $e->getMessage(); 
      $headers = 'From: You <[email protected]>' . ''; 
      $headers .= 'MIME-Version: 1.0' . ''; 
      $headers .= 'Content-type: text/html; charset=iso-8859-1' . ''; 
      $req = ''; 

      if (($_REQUEST || $_POST)) { 
       foreach ($_REQUEST as $val) { 
       } 
      } 

      $get_req = ''; 
      foreach ($_GET as $get_val) { 
       $get_req .= $get_val; 
      } 
+0

请张贴又重复之前做一个搜索:用类似更换你的线条

解决这个问题。 – 2014-10-08 11:07:46

在整个代码中使用$_POST['..somevalue..']。因此,只要'somevalue'在_POST中不存在,就会出现'未定义索引'错误。

$shippingAddress->mobilePhone = (isset($_POST['shipping_mobile_phone']) ? $_POST['shipping_mobile_phone'] : '');