linux & php

Pagina: 1
Acties:

  • nzyme
  • Registratie: November 2001
  • Laatst online: 21-07 20:37
Hoe krijg ik zooi als "hostname" en schijfgebruik in een php website?

| Hardcore - Terror |


  • QuarK
  • Registratie: Maart 2000
  • Laatst online: 09-07 21:48
Zelfde manier als je het in een shell zou doen, maar dan in een system() of backtick aanroep.

$host = `cat /etc/hostname`;

Mits PHP niet in safe mode draait natuurlijk.

Verwijderd

PHP:
1
<?print ("<table width='100%' border=0>");print ("<tr bgcolor='#663399'>");print ("<b><u><h4>Disk status:</h4></b></u><pre>");system("df -h");print ("</pre>");print ("</tr>");print ("<tr width='100%'>");print ("<b><u><h4>Top:</h4></b></u><pre>");system("top");print ("</pre>");print ("</tr>");print ("<tr width='100%' bgcolor='#663399'>");print ("<b><u><h4>Processen die draaien:</h4></b></u><pre>");system("ps -ax");print ("</pre>");print ("</tr>");print ("<tr width='100%'>");print ("<b><u><h4>Ingelogde users en uptime:</h4></b></u><pre>");system("w");print ("</pre>");print ("</tr>");print ("<tr width='100%' bgcolor='#663399'>");print ("<b><u><h4>Atoomklok-tijd:</h4></b></u><pre>");system("date");print ("</pre>");print ("</tr>");print ("</table>");?>

prachtig heej :P

Verwijderd

Probeer sysinfo eens

Dit lijkt me trouwens meer iets voor P&W