Find the answer to your Linux question:
Results 1 to 7 of 7
Hey guys, I am currently working on a personal website and I was wondering if anyone knew an html or css code I could use that would run when the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Oct 2004
    Location
    Vancouver
    Posts
    1,366

    html and system uptime...updated again


    Hey guys, I am currently working on a personal website and I was wondering if anyone knew an html or css code I could use that would run when the page is loaded and display the output from "uptime" or "uname -a" in the page?

    Thanks for your time,

    John

    I have tried this
    Code:
    <html>
    <iframe>
    
    <?php
    $data = shell_exec&#40;uptime&#41;;
    echo $data;
    ?>
    
    </iframe>
    </html>
    I don't exactly know much about php, so any pointers would be great, the site is in the button to my homepage with a quick link that says test...thanks guys,

    John
    Operating System: GNU Emacs

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    I THINK this may work, but I can't guarantee it:

    Code:
    <html>
    <iframe>
    
    <?php
    
    $data = localtime;
    print $data;
    ?>
    
    </iframe>
    </html>
    I dunno much PHP, but something like that works in CGI, and it may work happily for PHP.

  3. #3
    Linux Engineer
    Join Date
    Jan 2005
    Location
    Chicago (USA)
    Posts
    1,028
    Since your just learning HTML, learn XHTML before you get into outdated HTML 4.01 habits.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Oct 2004
    Location
    Vancouver
    Posts
    1,366
    sorry messed this one up
    Operating System: GNU Emacs

  6. #5
    Linux Engineer
    Join Date
    Oct 2004
    Location
    Vancouver
    Posts
    1,366
    ok, the problem I think is with iframe...which just displays a box with nothing inside...

    when I use the:
    Code:
    <html>
     <head>
     <title>Uptime Test</title>
     </head>
     <body>
    
    <?php
    $data = shell_exec&#40;uptime&#41;;
    echo $data;
    ?>
    
     </body>
    </html>
    Ok when I call it .php it works, but when I use .html its blank...iframe does not help...I really just want to embed it in my already there index.html...

    any clues?

    thanks
    Operating System: GNU Emacs

  7. #6
    Linux Engineer
    Join Date
    Jan 2005
    Location
    Chicago (USA)
    Posts
    1,028
    Use a borderless and scrollless (or is that two "l"s?) iframe with a src attribute that's a PHP file. Remember that iframe can't be an empty tag (<iframe src="iframe.php"/>), it must have a closing tag (<iframe src="iframe.php"></iframe>).

  8. #7
    Linux Engineer
    Join Date
    Oct 2004
    Location
    Vancouver
    Posts
    1,366
    BEAUTIFULLLLLLLLLLLL!!!! Thank You so Much a thing!!!

    I really appreciate the help...
    Operating System: GNU Emacs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •