将 php 变量添加到从之前转换为 php 的 html/javascript 语句中
Add a php variable to an html/javascript statement that is converted to php from before
这是一个包含一些html/javascript代码的php变量。这是从以前转换为 php,但我需要添加一个 php 变量。我有一个 php 变量是 $user->user_email
.如何在此处添加此变量:{this.value ='''';
?我的意思是该值向我显示了 php 变量。
$button .= '<input type="text" id="parspalpaiddownloads_email_'.$button_id.'" style="font-family: tahoma, verdana; font-size: 14px; line-height: 14px; margin: 5px 0px; padding: 3px 5px; background: #FFF; border: 1px solid #888; width: 200px; -webkit-border-radius: 3px; border-radius: 3px; color: #666; min-height:28px" value="'.esc_attr(__('Email', 'parspalpaiddownloads')).'" onfocus="if (this.value == '''.esc_attr(__('Email', 'parspalpaiddownloads')).'''){this.value =''''; this.style.textAlign= ''left''; this.style.direction= ''ltr'' }" onblur="if (this.value == '''') {this.value = '''.esc_attr(__('Email', 'parspalpaiddownloads')).'''; this.style.textAlign= ''right''; this.style.direction= ''rtl''}" /></div>';
你正在用''
筛选单引号,但实际上你必须打破字符串并注入你的变量。你的答案是
this.value ='''.$user->user_email.''';
点(.
)将弦部分连接成一个。
相关文章:
- 通过点击-PHP/HTML发布列表中的选定值
- 在网格中显示来自 PHP [HTML 的数据库的数据]
- 我希望我的php/html网站上的JavaScript能够实时更新
- 我在firebug控制台中得到了index.php.html
- 如何从php/html检查网站是否已打开
- jQuery Slider PHP/HTML Problems
- PHP/HTML:下载PDF链接处理页面加载
- 如何在 php/html 表单中编写链接
- 从生成的 PHP-HTML 表中获取数据库值
- PHP/HTML:如果 url domain.co.uk/?debug 那么
- 免费的应用程序来混淆和缩小JavaScript / PHP / HTML for Mac
- PHP/html:即时搜索功能:无法搜索外语(例如中文)字符
- Php/HTML/css:链接不可点击
- 在 PHP HTML 中向后单击时显示除图像外的所有值
- POST with ajax, php, html
- jquery json PHP HTML 不显示结果
- PHP HTML 表单选择选项来填充文本字段 jQuery
- PHP & HTML Form with javascript onsubmit not executed
- PHP/HTML:将HTML变量保存在PHP会话变量中
- 如何将渲染的PHP+HTML代码转换为文本文件