【发布时间】:2019-02-11 19:16:25
【问题描述】:
我是 php 新手,但我无法弄清楚问题所在。我正在尝试为字符串输入制作一个文本框。
<?php
$file = fopen("/file/location","r");
while(!feof($file)){
echo fgets($file);
echo "<br>";
}
fclose($file);
<html>
<form name="form" action="" method="get">
<input type="text" name="subject" id="subject" value="Car Loan">
</form>
</html>
echo $_GET['subject'];
<html> file_put_contents("/file/location", $_GET['subject'], FILE_APPEND); </html>
?>
第一部分运行良好,但是当我到达 <html> 时,它开始吐出各种错误。
【问题讨论】:
-
你在这里将纯 HTML 注入到 php 中。
-
另外,您应该会收到未定义的索引通知。