dtxf759200 2018-05-20 18:48
浏览 142
已采纳

尝试在PHP中回显表单数据时出现500错误

I am getting an error page from the server when trying to view my test.php page. Everything on the page loads fine if I remove the php tags. I am getting an "http error 500" with the following code:

<!doctype HTML>
<html>
<head>   
<meta charset="UTF-8">
<Title>Test</Title>  
<link rel="stylesheet" type="text/css" href="/CSS/default.css"> 
</head>
<body>
<?php
echo "<form>
<input type="hidden" name="uid" value="Anonymous">
<input type="hidden" name="date" value='".date()."'>
<textarea name="Message"></textarea><br>
<button type="submit" name="submit">Comment</button>
</form>";
?>
</body>
</html>
  • 写回答

3条回答 默认 最新

  • dqpfl2508589 2018-05-20 18:55
    关注

    Use the following:-

    <!doctype HTML>
    <html>
    <head>   
    <meta charset="UTF-8">
    <Title>Test</Title>  
    <link rel="stylesheet" type="text/css" href="/CSS/default.css"> 
    </head>
    <body>
    <?php
    echo "<form>
    <input type=\"hidden\" name=\"uid\" value=\"Anonymous\">
    <input type=\"hidden\" name=\"date\" value='".date()."'>
    <textarea name=\"Message\"></textarea><br>
    <button type=\"submit\" name=\"submit\">Comment</button>
    </form>";
    ?>
    </body>
    </html>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?