我有一个Joomla网站2.5.4,并使用Fabrik插件构建联系表单.当我提交联系表单时,我会收到JSON响应,而不是感谢您的页面.
我也从后端正确设置了表单.有关后端设置的详细信息,请参阅下图.

请检查下面的JSON响应
{
msg: "Record added/updated",
url: "index.php?option=com_content&view=article&id=24",
baseRedirect: false,
rowid: "0",
redirect_how: "newpage",
width: 300,
height: 300,
x_offset: 0,
y_offset: 0,
title: "",
reset_form: true
}
Run Code Online (Sandbox Code Playgroud) 我们正在计划php脚本与rails服务器上的ruby之间的交互,反之亦然.
每当我从php脚本卷曲发布数据时,在rails服务器通知显示 - "Can't verify CSRF token authenticity".
我在传递authenticity_token参数.我们需要如何在rails服务器上以安全的方式使用此令牌.
<?php
class active_merchant{
private $endpoint_url; // server address or url where data is to be posted.
private $params; // form fields
private $fields_count; // count of fields in credit card
public function __construct(){
$this->endpoint_url = "http://localhost:8080/activemerchant/index";
$token = md5('random');
$this->params = array('name'=>'test','authenticity_token'=>$token);
}
/* function curl_post
makes a curl post to the end point url
global variables
*/
public function curl_post(){
try{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->endpoint_url); …Run Code Online (Sandbox Code Playgroud)