Home  >  Article  >  CMS Tutorial  >  How to add verification code in custom form in DedeCMS

How to add verification code in custom form in DedeCMS

藏色散人
藏色散人Original
2020-01-04 09:53:522115browse

How to add verification code in custom form in DedeCMS

How to add verification code in the custom form of DedeCMS?

Dreamweaver DedeCMS adds verification code in the custom form

Recommended learning: 梦weavercms

1. First enter the DedeCMS backend Generate custom forms.

2. Add verification code to the custom form template, as follows:

 
看不清?点击更换  
看不清? 

3. Add JS code to the current page, as follows:

4. Modify the order Process the page, open the /plus/diy.php file in the website root directory, and add the verification code to around line 61. As follows:

if(!empty($dede_fields))
{
 $validate = empty($validate) ? '' : strtolower(trim($validate)); 
 $svali = strtolower(GetCkVdValue()); 
if(($validate=='' || $validate != $svali) && preg_match("/6/",$safe_gdopen)){
 ResetVdValue(); 
 ShowMsg('验证码不正确!',$dede_add,0,1000); 
 exit; 
}

Note: My custom form is proposed separately to make a template page and is called using columns.

The above is the detailed content of How to add verification code in custom form in DedeCMS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn