Home > Backend Development > PHP Tutorial > php显示页面在位置的问题

php显示页面在位置的问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-20 12:42:13
Original
835 people have browsed it

想将 echo显示到指定位置

<body><form name="form1" method="post"><input type="input" name="content" />//我想点击提交后将$aval 变量显示到这个文本框后面、提交前面的这个位置,<input type="submit" name="sub"  value="提交"/></form> </body></html><?phpif($_POST['sub']){    $aval = ($_POST['content']);    if ($aval == "")        $aval = "admin";    echo <form name="form1" method="post">$aval</form>;   //提示Parse error: syntax error, unexpected '<' in D:\WWW\login.php on line 16}  ?>
Copy after login


回复讨论(解决方案)

当echo的内容为html代码时候需要加引号

当echo的内容为html代码时候需要加引号



提示Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\WWW\2.php on line 16

echo "

{$aval}
";
或者
echo '<form name="form1" method="post">'.$aval.'</form>';
请仔细研究一下单引号的双引号的区别和用法

echo 后面改成

'<form name="form1" method="post">'.$aval.'</form>';
Copy after login
字符串用引号标注

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template