Jump to content

Recommended Posts

Well i queried the hrSWRunName (SNMP function) to get me the running softwares' name of my client in LAN network.

 

Well, i have one problem here. I code my program to list all the running software in real time, and echo the array in my webpage, but whenever i refresh the page, the newly open software or newly close software are not displayed, eventhough i refresh the page many times.

 

The only way to detect recent software running or closed is by closing the internet browser, and open the page again using new browser.

 

How do i solve this problem? so that i just refresh the page, and it will automatically displays the latest software running/closed?

 

Thx in advance

Link to comment
https://forums.phpfreaks.com/topic/84127-help-using-metarefresh/
Share on other sites

Your page is being cached by your browser. You need to send headers to the browser to expire the page. I think the ones of interest are

<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

 

note: the above information was kindly supplied by the php.net website. For further header information see http://uk2.php.net/header

Ok, this is just the bit of my code fragment that touch about retrieving running software's name:

 

 

<?php

 

$test = @ snmpwalk("192.100.100.7", "public", ".1.3.6.1.2.1.25.4.2.1.2", 5);

 

 

foreach ($test as $val) {

echo "$val

 

";

}

 

?>

 

<p><?php echo '<META HTTP-EQUIV="refresh" CONTENT="5; URL=monitor.php">'; ?></p>

 

 

 

the problem is it seems that whenever i refresh the page, the value of the retrieved software names doesnt change, eventhough there are changes made (e,g: closing a software)

 

i have to close the browser, then re-run the script, only will the changes occur.

 

pls help, and thx in advance.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.