Run shell using web

Hi,
I create shell script that can run using web browser.
The problem is when I put
echo "<pre> $(df -h) </pre>" I can see output in browser

But when I issue
echo "<pre> $(su - postgres -c 'SELECT * FROM .....') </pre>"
I can't see anything????

It seems the output from the postgre database is in tabular format which requires some formatting.
Try to put the following code snippet in your script

echo "Content-type: text/html"

My script include this line already...

I see, It seems that you have to loop through the output that came from postgre database table and and rebuild that table to be in html formatted table.

how to do that???

The answer as follows
1- Mainly it depneds on shell and html scripting skills , As I'm no scrpting expert
2- On your database table layout

I'll try to post when I find something that might suits your needs or just let us wait for someone to share his expertise with us.

Ok-I solved problem.You need to use sudo to query database.