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 .

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

报告相同问题?

悬赏问题

  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题