我需要一些帮助...... 当我点击提交网址 http://thom239u.keaweb.dk/php/dag5_3.php?name=Thomas&comments=Sweet%0D%0A
我如何清楚地说明: http://thom239u.keaweb.dk/php/dag5_3.php 因为我开始......
<?php
$guest = file_get_contents("kommentar.txt");
if(isset($_GET["name"])){
$name = $_GET["name"];
$comment = $_GET["comments"];
$guest .= $name . "<br>" . $comment . "<br>";
$data = file_put_contents("kommentar.txt", $guest);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="uft-8">
<title>Thomas Hansen</title>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<link href="special.css" rel="stylesheet" type="text/css">
</head>
<body>
<h1>Apple</h1>
<form action="dag5_3.php" method="get">
<label for="name"></label> <input type="text" name="name" id="name" placeholder="Navn"><br>
<textarea rows="4" cols="50" placeholder="Kommentar" id="comments"></textarea>
<input type="submit" value="Send">
</form>
<?php
//echo udskriver
echo "Du er viewer nummer: " . $count . "<br>" . "<br>" . "<br>";
echo "$guest";
?>
<script src="dag1.js"></script>
</body>
</html>
答案 0 :(得分:0)
你的textarea应该是
<textarea rows="4" cols="50" placeholder="Kommentar" id="comments" name="comments"></textarea>
^.............^