本文整理汇总了PHP中site::protocol方法的典型用法代码示例。如果您正苦于以下问题:PHP site::protocol方法的具体用法?PHP site::protocol怎么用?PHP site::protocol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类site
的用法示例。
在下文中一共展示了site::protocol方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
public function handle()
{
/*数据验证*/
$validator = new Validation($this->fileds);
$validator->pre_filter('trim');
$validator->add_rules('account', 'required');
$validator->add_rules('submit_url', 'required');
if (!$validator->validate()) {
$validate_errors = $validator->errors();
$errors = '';
foreach ($validate_errors as $key => $val) {
$errors .= $key . ' failed rule ' . $val . '<br>';
}
throw new PaymentException($errors, 400);
}
$this->fileds['submit_url'] = str_replace("{acount}", $validator->account, $validator->submit_url);
$protocol = site::protocol();
echo "<div style='display:hidden'>" . "<form name='jump_form' action='" . $this->fileds['submit_url'] . "' method='post'>" . "<input type='hidden' name='item_name_1' value='" . $this->fileds['item_name_1'] . "'/>" . "<input type='hidden' name='item_description_1' value='" . $this->fileds['item_description_1'] . "'/>" . "<input type='hidden' name='item_quantity_1' value='" . $this->fileds['item_quantity_1'] . "' />" . "<input type='hidden' name='item_price_1' value='" . $this->fileds['item_price_1'] . "'/>" . "<input type='hidden' name='item_currency_1' value='" . $this->fileds['item_currency_1'] . "'/>" . "</form></div>" . "<script language=javascript>" . "onload=function (){" . "\tdocument.jump_form.submit();" . "}" . "</script>" . "<div>It's turning to secure payment page...<br/>" . "<a href='javascript:void(0);' onclick='document.jump_form.submit();return false;'>Click here if your browser does not automatically redirect you.</a>." . "</div>" . "";
exit;
}