Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

A page that checks dates of files and displays whos on??

What I am trying to acomplish is..

   I have a site that consists of 10 people they use webcam32 to take pics and upload at an interval. I am trying to create a page that checks the picture files and determines if the user is online and somehow show they are online (displaying a still with there name as link). The files are overwritten everytime a new pic is uploaded and the images run at a 1 second interval so I thought it would be easy to check if the file was recently modified. Would I be better doing this in another language like cgi ??

Thanks for any pointers or ideas

Eric
0
ehc_fl
Asked:
ehc_fl
1 Solution
 
VGRCommented:
Yes, and I've something like this. I wrote a Pascal/Delphi CGI "console" application to manipulate/resize the image.

For only checking the last-modified time of the file, no, you don't need CGI : PHP has "filesystem" functions able to retrieve a lot of datetime values on files (creation, modification, last access, althought some do not work on Win32)

To check that the user is online, either you stick with you idea of checking "last modification" time of images, or you PING him/her. This may also be accomplished in pure PHP (depending on server's settings)
0
 
KC_SpeedballCommented:
you're programming in delphi VGR? Great im looking for someone who do this. I need someone telling how to connect with delphi to an mysql-database (with ODCB pleeeeaaaasee)
any usefull links?

Sorry ehc_fl for braking you question ;)
0
 
VGRCommented:
I suceeded some time ago in D4 with the standard libmysql.dll wrapped in Delphi

I have not tried since a while
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
us111Commented:
Store somewhere when the user is logged and check the file picture date time in pure PHP (see VGR comment)

http://www.php.net/manual/sv/ref.filesystem.php
0
 
ehc_flAuthor Commented:
<?php
// outputs if User is Online or offline by comparing date of file
$today = date("F d Y H"); // Month, Day, Year, Hour read into string
$online = date("i")- 1; // read Server minute into string
$cam = './cams/eric.jpg'; // File to be checked
if (date ("F d Y H", filemtime($cam))==$today)  {// Check if File date,Hour
equal to Server
    if (date ("i", filemtime($cam))>=$online) { // Check if file minute >=
Server
    echo "<B>Currently Online</B>"; // Show user is online File is within 1
minute or equal to Server
    }
   else // File is older than 1 minute of Server Time so treated as offline
   {
   echo "<b>Currently Offline</B>"; // Show user as offline
   }
}
else
{
    echo "<b>Currently Offline</B>"; // Show user as offline
}
?>
This is the code I threw together lastnight. I figured I would pass it on

Eric
0
 
VGRCommented:
well, cool 8-))
Easy points for us111 :D
especially since he (honestly) quoted MY comment :D

cool cool cool
0
 
VGRCommented:
and not grade "B" please. If he answered your question right, give him grade "A"
0
 
us111Commented:
;)
yep but the link!!  ;)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now