Aller au contenu

Résultat d'une commande en html ou php


dexmon

Sujets conseillés

Salut,

voilà je cherche le moyen de, via un script .cgi ou .pl d'afficher le résultat de cette commande unix sur le serveur web :

linux~#:pure-ftpwho -w
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-15" />
<title>Pure-FTPd server status</title>
<style type="text/css">
html {
background-color: #369;
}
body {
background-color: #fff;
color: #000;
margin: 12px;
padding: 8px;
border: 2px solid #000;
font-family: "Trebuchet MS",Verdana,Geneva,Arial,Helvetica,sans-serif;
font-size: 0.8em;
}
h1 {
text-align: center;
border-bottom: 1px solid #666;
margin: 0.5em 1em;
}
#ftp-status {
text-align: center;
}
table {
margin: 0 auto;
}
thead th {
background-color: #369;
color: #fff;
}
th,td {
padding: 0.1em 0.5em;
}
tr:hover {
background-color: #def;
}
</style>
</head>
<body>
<h1>Pure-FTPd server status</h1>
<div id="ftp-status">
<table summary="Pure-FTPd server status">
<thead>
<tr>
<th scope="col">PID</th>
<th scope="col">Account</th>
<th scope="col">Time</th>
<th scope="col">State</th>
<th scope="col" abbr="File">File name</th>
<th scope="col" abbr="Peer">Remote host</th>
<th scope="col" abbr="Kb">Kbytes</th>
<th scope="col" abbr="Local">Local host</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">18365</th>
<td>glinux</td>
<td>00:01</td>
<td>IDLE</td>
<td> </td>
<td>localhost.localdomain</td>
<td> </td>
<td>localhost.localdomain:21</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

Et voici le résultat sur le navigateur:

pureftpwhovf4.png

Comment faire ?

Car je dois chaque fois tapper la commande sur le shell et ensuite me dirigez vers la page pour afficher le résultat et j'aimerais que ça se fasse automatiquement dés que je vais sur http://localhost/traffic_ftp.html

Modifié par Portekoi
Lien vers le commentaire
Partager sur d’autres sites

Veuillez vous connecter pour commenter

Vous pourrez laisser un commentaire après vous êtes connecté.



Connectez-vous maintenant
×
×
  • Créer...