duanhe7471 2011-03-23 08:54
浏览 179
已采纳

制作一个简单的留言簿

If you have an html and you sumbit it to a basic PHP file receiver, I wonder how you make them add up. how do you make the submitted forms stack instead of each submission replacing the other? I have no clue where to even start looking for an answer.

wrap print statements and make wrap element an array? do i need file I/O for this so the messages get stored somewhere?

PHP is a very confusing jungle for me at the moment. Note that I haven't gotten to the database part of php in my course yet.

many thanks in advance

  • 写回答

3条回答 默认 最新

  • dongshenling6585 2011-03-23 09:05
    关注

    Of course you will need file I/O to store messages.
    Otherwise how they are supposed to be saved? So, you have to save your messages in a file.

    To add new data at the bottom of the file you have to append it instead of rewriting.

    if you're using file_put_contents function, use it with FILE_APPEND flag:

    file_put_contents($file, $data, FILE_APPEND);
    

    if you're using fopen(), use 'a' mode instead of 'w'

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭