doumao8355 2018-06-22 16:22
浏览 96
已采纳

HTML和PHP中的注释表单不显示

i am very new with html/css too with php and my English is very poor.. so , my problem ... , i have this Codec from here . I have Three File , the First is index.php

<html> 
<head> 
<link rel="stylesheet" href="style.css" type="text/css"> 
</head> 

<body> 
<form action="" method="POST"> 
<label>Name: 
<input type="text" name="Name" class="Input" style="width: 225px" required> 
</label> 
<br><br> 
<label> Comment: <br> 
<textarea name="Comment" class="Input" style="width: 300px" required> </textarea> 
</label> 
<br><br> 
<input type="submit" name="Submit" value="Submit Comment" class="Submit"> 
</form> 
</body> 
</html> 

<?php 

    if($_POST['Submit']){  



        $Name = $_POST['Name']; 
        $Comment = $_POST['Comment']; 


        #Get old comments 
        $old = fopen("comments.txt", "r+"); 
        $old_comments = fread($old, 1024); 


        #Delete everything, write down new and old comments 
        $write = fopen("comments.txt", "w+"); 
        $string = "<b>".$Name."</b><br>".$Comment."<br>
".$old_comments; 
        fwrite($write, $string); 
        fclose($write); 
        fclose($old); 
    } 

        #Read comments 
        $read = fopen("comments.txt", "r+"); 
        echo "<br><br>Comments<hr>".fread($read, 1024); 
        fclose($read); 


?>

Than a style.css File and a empty with the name comments.txt . This Files i have to a Computer (computer A) , with apache , start it with , /etc/init.d/apache2 restart .In another Computer (computer B) i write to Browser, 192.345.345.100/index.php , in Name i write my name and in Comment , a comment.. ,what come nothing.... .Image from mine Browser enter image description here , can please anyone help me , Thanks !

The image from Computer B , in Browser write http://192.345.345.100/info.php ,info.php which i have to build with <?php phpinfo(); ?> .

See stacktrace:

enter image description here

  • 写回答

1条回答 默认 最新

  • dongyinpan9284 2018-06-23 13:45
    关注

    Edit new my comment... , i had two problem because PHP not display.... . First ,me messing some modules for PHP , libapache2-mod-php7.0..

    Seconds ,i not had access right to my Website... , with sudo chown -R www-data:www-data /var/www/html , i have this Right to give.... image how the Website see with the Comments , The Code remain identical...

    @user3783243 , today i to red this , how Understand , t convert to , it is ONLY for Windows user.. , Linux ignored it ... .

    is used for Unix systems (including Linux, and OSX).

    is mainly used on Windows.

    is used on really old Macs.

    from Here .

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改