simple way to display data in a .txt file on a webpage?

后端 未结 8 1039
遥遥无期
遥遥无期 2020-12-13 02:23

Working on a project, one of the webpages will display a list of people (specifically, a list of people from a graduation class that haven\'t been located yet). Instead of m

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 02:43

    That's the code I use:

    $file
                
                    
    ".htmlspecialchars(file_get_contents("$path/$file"))."
    "; //display echo $content; ?>

    Keep in mind that if the user can modify $path or $file (for example via $_GET or $_POST), he/she will be able to see all your source files (danger!)

提交回复
热议问题