任何人都知道为什么:
class Booking extends Controller {
function booking()
{
parent::Controller();
}
function send_instant_to_paypal()
{
print_r($_POST);
echo '<hr />';
print_r($this->input->post());
echo '<hr />';
$id_booking = $this->input->post('id_booking');
$title = $this->input->post('basket_description');
$cost = ($this->input->post('fee_per_min') * $this->input->post('amount'));
echo $id_booking;
echo $title
echo $cost
}
}
将在 CI 中为 $_POST 回显 post 变量
但不适用于 $this->input->post();?
我有
$this->input->post() 正在使用并在网站其他地方的搜索页面上工作......但在这个页面上,它不起作用..
这是我的表格...
这是精神上的;-p
有人发现我遗漏的任何明显愚蠢的东西吗?
最佳答案
您很可能启用了 XSS 或 CSRF,它将禁止(在这里猜测)Paypal 将这些详细信息返回给您。
这是 CodeIgniter 的典型情况,并且有一些变通方法,例如为某些 Controller 排除 CSRF(通过配置或 Hook )。
如果您提供更多关于 POST
位置的详细信息来自我可以清楚地回答。
编辑
可能是您正在调用$this->input->post()
不正确?我知道 CI2.1 增加了对 $this->input->post()
的支持返回完整的数组,但在此之前,您必须明确定义您想要的后变量 ala:$user = $this->input->post('username');
关于CodeIgniter POST 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5409485/