Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 联系人表单某些字符显示为html实体_Php_Wordpress_Forms_Contact_Html Entities - Fatal编程技术网

Php 联系人表单某些字符显示为html实体

Php 联系人表单某些字符显示为html实体,php,wordpress,forms,contact,html-entities,Php,Wordpress,Forms,Contact,Html Entities,我的php联系人表单将特殊字符作为html实体发送。。我不明白为什么 //the field echo '<textarea rows="10" cols="35" name="cf-message" placeholder="' . __('Your message', 'ad-html5-form') . '" required>' . ( isset( $_POST["cf-message"] ) ? esc_attr( stripslashes($_POST['cf-mess

我的php联系人表单将特殊字符作为html实体发送。。我不明白为什么

//the field
echo '<textarea rows="10" cols="35" name="cf-message" placeholder="' . __('Your message', 'ad-html5-form') . '" required>' . ( isset( $_POST["cf-message"] ) ? esc_attr( stripslashes($_POST['cf-message']) ) : '' ) . '</textarea>';

//retrieving the field
$message        = esc_textarea( stripslashes($_POST['cf-message']) );
//该字段
回显“”。(isset($_POST[“cf-message”])?esc_attr(stripslashes($_POST[“cf-message”]):“”);
//检索字段
$message=esc_textarea(带斜杠($_POST['cf-message']);

它可以很好地处理中文、日文、希伯来文或阿拉伯文等字符,但它不发送撇号,&,您应该使用
ecs_html
而不是
esc_attr
,这将帮助您从表单中消除符号而不是html问题。如果您的表单现在完全使用上述代码

例如:

$html = esc_html( '<a href="http://www.example.com/">A link</a>' );
将在HTML文档中显示为:

<a href="http://www.example.com/">A link</a>

与此相反: 找到的解决方案:

在功能中发送邮件

esc_textarea( stripslashes($_POST['cf-message']) );
不得不改成

stripslashes(trim($_POST['cf-message']));

尝试htmlentities和html_entity_decode。您能编辑并包含整个代码吗?您好,GTS软件,谢谢您的回复。我确实尝试了HTMLEntity和html实体解码,不幸的是没有运气..嗨Ajesh,完整的代码添加,谢谢你的时间可以使用ecs的html而不是esc的attr。您的表单是否正在使用上述代码??
esc_textarea( stripslashes($_POST['cf-message']) );
stripslashes(trim($_POST['cf-message']));