如何清除网址

问题描述 投票:0回答:1

我需要一些帮助......当我点击提交网址时 http:/thom239u.keaweb.dkphpdag5_3.php?name=Thomas&comments=Sweet%0D%0A。

我怎么才能让它清除到。http:/thom239u.keaweb.dkphpdag5_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>
php url
1个回答
0
投票

你的文本区域应该是

<textarea rows="4" cols="50" placeholder="Kommentar" id="comments" name="comments"></textarea>
                                                                   ^.............^
© www.soinside.com 2019 - 2024. All rights reserved.