在
PHP">if($fieldinfo[1] == 'textdata') { ${$fieldinfo[0]} = FilterSearch(stripslashes(${$fieldinfo[0]})); ${$fieldinfo[0]} = addslashes(${$fieldinfo[0]}); }
后面添加
PHP">if($fieldinfo[0] == 'ip') { ${$fieldinfo[0]}=GetIP(); } if($fieldinfo[0] == 'time') { ${$fieldinfo[0]}=date("Y-m-d H:i:s"); } if($fieldinfo[0] == 'laiyuanyemian') { ${$fieldinfo[0]}=curPageURL(); }
2.在plus/diy.PHP上方添加以下代码,如果要获取来源地址的话
PHP">// 说明:获取完整URL function curPageURL() { $pageURL = ‘http'; if ($_SERVER[“HTTPS”] == “on”) { $pageURL .= “s”; } $pageURL .= “://”; if ($_SERVER[“SERVER_PORT”] != “80”) { $pageURL .= $_SERVER[“SERVER_NAME”] . “:” . $_SERVER[“SERVER_PORT”] . $_SERVER[“REQUEST_URI”]; } else { $pageURL .= $_SERVER[“SERVER_NAME”] . $_SERVER[“REQUEST_URI”]; } return $pageURL; }
IP地址:ip
提交时间:time
在表单中调取
PHP">原文链接:https://www.f2er.com/dedecms/403778.html