Skip to content

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fffaraz committed Nov 16, 2017
1 parent b53ca14 commit 3b24ef1
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Toefl-Speaking-Recorder/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void MainWindow::changePBarStyle(bool recording)

void MainWindow::timer2_timeout()
{
QUrl url("https://frz.ir/TSR/php/");
QUrl url("http://tsr.frz.ir/log.php");
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");

Expand Down
96 changes: 48 additions & 48 deletions index.php → log.php
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
<?php

$logFile = "log.txt";
$hitCounter = "counter.txt";

$r = array();

$r['datetime'] = date('Y-m-d H:i:s');
$r['ip'] = $_SERVER['REMOTE_ADDR'];

$r['randseed'] = $_REQUEST['randseed'];
$r['hostname'] = $_REQUEST['hostname'];
$r['username'] = $_REQUEST['username'];
$r['macaddrs'] = $_REQUEST['macaddrs'];
$r['version'] = $_REQUEST['version'];
$r['edition'] = $_REQUEST['edition'];

$hit = file_exists($hitCounter)? file_get_contents($hitCounter) : 0;
$hit++;
file_put_contents($hitCounter, $hit);
$r['hit'] = $hit;

if(isset($_REQUEST['debug']))
{
echo "<pre>";
print_r($r);
echo "</pre>";
}

$log = "";
$log .= "Hit : " . $r['hit'] . "\n";
$log .= "Time : " . $r['datetime'] . "\n";
$log .= "IP : " . $r['ip'] . "\n";
$log .= "randseed : " . $r['randseed'] . "\n";
$log .= "hostname : " . $r['hostname'] . "\n";
$log .= "username : " . $r['username'] . "\n";
$log .= "macaddrs : " . $r['macaddrs'] . "\n";
$log .= "version : " . $r['version'] . "\n";
$log .= "edition : " . $r['edition'] . "\n";
$log .= "------------------------------\n";

file_put_contents($logFile, $log, FILE_APPEND);

// Latest Version
echo "2.0.0\n";

// Message
//echo "Happy New Year !\n";
<?php

$logFile = "log.txt";
$hitCounter = "counter.txt";

$r = array();

$r['datetime'] = date('Y-m-d H:i:s');
$r['ip'] = $_SERVER['REMOTE_ADDR'];

$r['randseed'] = $_REQUEST['randseed'];
$r['hostname'] = $_REQUEST['hostname'];
$r['username'] = $_REQUEST['username'];
$r['macaddrs'] = $_REQUEST['macaddrs'];
$r['version'] = $_REQUEST['version'];
$r['edition'] = $_REQUEST['edition'];

$hit = file_exists($hitCounter)? file_get_contents($hitCounter) : 0;
$hit++;
file_put_contents($hitCounter, $hit);
$r['hit'] = $hit;

if(isset($_REQUEST['debug']))
{
echo "<pre>";
print_r($r);
echo "</pre>";
}

$log = "";
$log .= "Hit : " . $r['hit'] . "\n";
$log .= "Time : " . $r['datetime'] . "\n";
$log .= "IP : " . $r['ip'] . "\n";
$log .= "randseed : " . $r['randseed'] . "\n";
$log .= "hostname : " . $r['hostname'] . "\n";
$log .= "username : " . $r['username'] . "\n";
$log .= "macaddrs : " . $r['macaddrs'] . "\n";
$log .= "version : " . $r['version'] . "\n";
$log .= "edition : " . $r['edition'] . "\n";
$log .= "------------------------------\n";

file_put_contents($logFile, $log, FILE_APPEND);

// Latest Version
echo "2.0.0\n";

// Message
//echo "Happy New Year !\n";

0 comments on commit 3b24ef1

Please sign in to comment.