繁体   English   中英

php/html 在表单中显示带空格的文本

[英]php/html show text with spaces in form

我在 php 中有以下代码。问题是在输入地址中只显示第一个单词。 我认为串联会发生一些事情,但我不知道如何解决。

$Name="John;
$Surname="Borg";
$Address="Leoforos Lemesou, 74";
echo '
  <form method="post">
            <label for="name">Name:</label><br>
            <input type="text" id="name" name="name" value=' . $Name . ' /><br>
            <label for="surname">Surname:</label><br>
            <input type="text" id="surname" name="surname" value=' . $Surname . ' /><br>
            <label for="address">Address</label><br>
            <input type="text" id="address" name="address" value=' . $Address . ' /><br>

            <input type="submit" name="edit" value="Edit">
        </form>
    ';

您忘记在地址值周围添加引号。 您实际上应该为所有文本字段添加它!


暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM