Jump to content
Sign in to follow this  
Romm

Write information to text file on server

Recommended Posts

Romm

Ok here is idea.

When user starts programm it sends information about time to txt file on web server.

Something like this

10:00 Programm opened.

11:05 Programm closed.

12:14 Programm opened.

13:18 Programm closed.

But not rewrite info, just add...

How to script this?

Thanks for help.

Edited by Romm

Share this post


Link to post
Share on other sites
cppman

Here is a quick example using my server.

Click here to view the contents of the file

#include <IE.au3>

_Example("Somebody tried this example at " & @HOUR & ":" & @MIN & @CRLF)

Func _Example($q = "hello world")
    $oIe = _IECreate("http://www.bloxsoftware.com/example/example.php?q=" & $q, 0, 0)
    _IEQuit($oIe)
EndFunc

You need to make a PHP script that will appen the text to the file.

<?
       $text = $_GET["q"];
       echo("Added text... " .$text);
       $file = fopen("example.txt", "a");
       fwrite($file, $text . "\r\n");
       fclose($file);
   ?>

This probably isn't the best way, but heh, it works.

NOTE: If you do use this method, you might want to take some security measures.

Edited by chris95219

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

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.