I want to create a HTML page that will have a table that will populate itself with info from 2 .txt files that are on a remote Linux Server.
or populate a html page on that remote server with the same info from those 2 .txt files and then access that html page using apache’s webserver.
something as basic as possible would be nice but I can understand if it’s complicated to do with html
honestly, any help at all would be nice.
I would personally do it in
PHP. You can read the file andechoit into a table. You can then use the lines of the file for anything you want. I put comments in explaining each step. All you have to do is change$filepathto point at your text file:Edited: Edited the code to add constraints mentioned by OG poster in comments. There is probably a more optimized way of performing your task, but this works and should introduce some new concepts to you if you are new to PHP
I’ll do my best to explain it line by line instead of flooding the scrip with comments:
<table>‘)explode) the line at all of the | characters. Use this array of split up content and for each piece of content,echoout a new column in the existing row with the current content. Otherwise, there is not | found and you can just echo the line into a row normally</table>‘)Edit #2: The original solution I posted: