Skip to content
Advertisement

Output results from Linux command into a table with PHP

I’m mid way through clobbering together a captive portal to run on a Raspberry Pi and have the basics working, but I’m now stumbling whilst creating some administration pages.

What I am essentially trying to do is create a table in HTML/PHP so that I have the ability to “kick” users from the service. I have a script already in place that does this, but I’m struggling to echo the results of an exec statement into a table.

This is how far I’ve managed to get:

JavaScript

This outputs to a table, but not into a row per IP. I’d like this to be a new row so that I can then add a third column to contain something like

JavaScript

Any suggestions greatly appreciated.

Advertisement

Answer

Got this working with the following:

JavaScript

Which now outputs as:

JavaScript

Thanks for the assistance!

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement