有时候公司需要举行会议,通过微信宣传实现在线报名支付,这里介绍一下怎样通过dede织梦系统的自定义表单实现在线报名微信支付。
微信审核通过后,微信公众号要进行相应设置,前面文章有过介绍
首先后台新建表单,并加入报名需要提交的字段


表单的模板只需要发布模版,我们先不制作模板,先前台预览一下报名表单,地址:diy.php?action=post&diyid=你的表单id,
用浏览器的查看代码功能,找到:
<form action="/plus/diy.php" enctype="multipart/form-data" method="post">
<input type="hidden" name="action" value="post" />
<input type="hidden" name="diyid" value="2" />
<input type="hidden" name="do" value="2" />
我这表单的id是2,根据自己情况id不一样
再找到下面:
<input type="hidden" name="dede_fields" value="inputname,text;inputphone,text;email,text;company,text;job,text;price,text;orderid,text;ispay,text" />
<input type="hidden" name="dede_fieldshash" value="9c0a1eaa8365c72a13284bd8161e832b" />
这个是要验证表单的代码,后面做模板需要用到这两块


下面我们找一个手机版报名表单,把表单输入框的名称与上一步中的表单名对应。

注意到表单提交页面diy.php,我们要修改一下diy.php,在提交问报名信息后,转到微信支付页上,打开diy.php,大概89行
$id = $dsql->GetLastID();
在后面加上如下代码:
if($diyid==2){//根据你的报名表单id填写
header("Location: http://www.xxx.com/wx/zhifu.php?order_id=$id"); //你的支付地址
exit;
}else{
最后在showmsg($bkmsg, $goto);后面加个大括号“}”

在支付代码中,支付成功后更新一下表单的状态为已支付,有时间下次发布支付代码。
注意:dede后台自定义表单要选择不公开
注意:dede后台自定义表单要选择不公开
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!