PHP-在输入框中显示检索到的电子邮件地址
我想使用 php/html 从 MySQL 检索电子邮件地址(以及其他信息),然后在表单的输入框中显示电子邮件地址。这将使用户能够编辑和提交更正的电子邮件地址。但是,检索到的电子邮件地址在输入框中无法正确显示。所有其他检索到的信息均正确显示。部分代码如下所示:
<tr><td ><span style=color:#125eaa><strong>Email</strong></style></td><td ><input style=background-color:#e2ffc6 name=email type=text id=email value=$email></td></tr>
<tr><td ><span style=color:#125eaa><strong> Address Line 1</strong></style></td><td ><input style=background-color:#e2ffc6 name=ad1 type=text id=ad1 value='$ad1'></td></tr>
“地址行 1”显示正确,但电子邮件不显示。我尝试过:type=email,但没有解决问题。
非常感谢任何帮助。
谢谢,
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and then display the email addresses in an input box on a form. This will enable users to edit and submit corrected email addresses. However the retrieved email address does not display correctly in the input box. All other retrieved information display correctly. A section of the code is as shown below:
<tr><td ><span style=color:#125eaa><strong>Email</strong></style></td><td ><input style=background-color:#e2ffc6 name=email type=text id=email value=$email></td></tr>
<tr><td ><span style=color:#125eaa><strong> Address Line 1</strong></style></td><td ><input style=background-color:#e2ffc6 name=ad1 type=text id=ad1 value='$ad1'></td></tr>
The "Address Line 1" displays correctly but the email does not. I tried: type=email, but it did not resolve the issue.
Any help greatly appreciated.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所有属性都加上引号。而且,在没有看到更多代码的情况下,我只能假设您需要使用 php 显示变量,而不仅仅是直接的 HTML。您还可以使用关闭
标签,而不是关闭
标签。
Put quotes around all attributes. And, without seeing more code I can only assume you need to display the variables with php, not simply straight HTML. You've also got closing
</style>
tags instead of closing</span>
tags.他的问题可能是驻留 javascript 的产物,该 javascript 通过脚本混淆来掩盖电子邮件地址,这就是为什么他看到部分开始脚本标记的原因。在将电子邮件地址写入输入语句中的值之前禁用隐藏脚本。
His problem could be an artifact of a resident javascript that's cloaking the e-mail address with a script obfuscation, which is why he's seeing part of the opening script tag. Disable the cloaking script before writing e-mail addresses to values in input statements.