织梦dede自定义表单自动获取IP地址和提交时间

 时间:2024-10-21 07:43:03

1、第一步:在根目录中找到plus/diy.php文件,然后查找下面的代码  if($fiel蟠校盯昂dinfo[1] == 'textdata')  {  ${$fieldinfo[0]} = FilterSearch(stripslashes(${$fieldinfo[0]}));  ${$fieldinfo[0]} = addslashes(${$fieldinfo[0]});  }后面添加  if($fieldinfo[0] == 'ip')  {  ${$fieldinfo[0]}=GetIP();  }  if($fieldinfo[0] == 'time')  {  ${$fieldinfo[0]}=date("Y-m-d H:i:s");  }添加完后代码如下图:

织梦dede自定义表单自动获取IP地址和提交时间

2、第二步:后台添加对应字段(也就是要抓取的IP和time字段)网站后台找到自定义表单---->编辑---->添加字段

织梦dede自定义表单自动获取IP地址和提交时间织梦dede自定义表单自动获取IP地址和提交时间织梦dede自定义表单自动获取IP地址和提交时间

3、第三步:修改前端html页面找到你网站提交信息页面的模板文件,然后查找下面的代码:<input type="hidden" name="dede_fields"如图:

织梦dede自定义表单自动获取IP地址和提交时间

4、第四步:在第三步找到的代码前面添加下面的信息:(重要提示:第二步添加的字段要跟下面中的name相互对应)<input type="hidden" name="ip" id="ip" value=""><input type="hidden" name="time" id="time" value="">

织梦dede自定义表单自动获取IP地址和提交时间

5、第五步:给第三步中找到的代码添加信息:ip,text;time,text例如:<input type="hidde荏鱿胫协n" name="dede_fields" value="city,select;area,text;shi,select;ting,select;chu,select;wei,select;yangtai,select;xm,text;tel,text;dizhi,text;fengge,text" />添加后(加粗的代码就是需要添加的代码):<input type="hidden" name="dede_fields" value="city,select;area,text;shi,select;ting,select;chu,select;wei,select;yangtai,select;xm,text;tel,text;dizhi,text;fengge,text;ip,text;time,text" />

织梦dede自定义表单自动获取IP地址和提交时间

6、最后提醒大家,如果您在修改以后发现提示:“数据校验不对,程序返回”,请点击下面链接

  • 备案网站迁移这样弄会被判定为空壳网站
  • 棋牌游戏平台开发:棋牌运营如何做好推广?
  • 锅炉热电机组DEH操作说明?
  • ZEQ丰臀打造诱惑美臀翘臀法
  • 篮球比赛还可以在直播(8)吧 里看的
  • 热门搜索
    千与千寻简介 有过敏性鼻炎怎么办 营养减肥晚餐 把信送给加西亚简介 奇迹暖暖攻略 黑色大衣怎么搭配 预产期到了还没生怎么办 李玉刚简介 敦煌攻略 肚子大如何减肥