|
@@ -1,29 +1,28 @@
|
|
<?php
|
|
<?php
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
+
|
|
-
|
|
+$servername = "localhost";
|
|
-$servername = "localhost";
|
|
|
|
$username = "put_username";
|
|
$username = "put_username";
|
|
$password = "put_password";
|
|
$password = "put_password";
|
|
-$dbname = "db_ifractions";
|
|
+$dbname = "db_ifractions";
|
|
|
|
|
|
-$tablename = "ifractions";
|
|
+$tablename = "ifractions";
|
|
|
|
|
|
function remove_accents ($stripAccents) {
|
|
function remove_accents ($stripAccents) {
|
|
-
|
|
+
|
|
- $stripAccents = strtr($stripAccents,
|
|
|
|
- 'àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ',
|
|
|
|
- 'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY');
|
|
|
|
- $stripAccents = preg_replace('/[^\x20-\x7E]/','', $stripAccents);
|
|
|
|
- */
|
|
|
|
return $stripAccents;
|
|
return $stripAccents;
|
|
-}
|
|
+ }
|
|
|
|
|
|
-
|
|
+
|
|
function clientIP () {
|
|
function clientIP () {
|
|
if (getenv("HTTP_CLIENT_IP"))
|
|
if (getenv("HTTP_CLIENT_IP"))
|
|
$ip = getenv("HTTP_CLIENT_IP");
|
|
$ip = getenv("HTTP_CLIENT_IP");
|
|
@@ -35,9 +34,9 @@ function clientIP () {
|
|
$resp = gethostbyaddr($ip);
|
|
$resp = gethostbyaddr($ip);
|
|
if (isset($resp) && strlen($resp)>0) {
|
|
if (isset($resp) && strlen($resp)>0) {
|
|
$strIP .= "; " . $resp;
|
|
$strIP .= "; " . $resp;
|
|
- }
|
|
+ }
|
|
return $strIP;
|
|
return $strIP;
|
|
-}
|
|
+ }
|
|
|
|
|
|
|
|
|
|
$conn = new mysqli($servername, $username, $password, $dbname);
|
|
$conn = new mysqli($servername, $username, $password, $dbname);
|
|
@@ -45,7 +44,7 @@ $conn = new mysqli($servername, $username, $password, $dbname);
|
|
|
|
|
|
if ($conn->connect_error) {
|
|
if ($conn->connect_error) {
|
|
die("Connection failed: " . $conn->connect_error);
|
|
die("Connection failed: " . $conn->connect_error);
|
|
-}
|
|
+ }
|
|
|
|
|
|
$ip = clientIP();
|
|
$ip = clientIP();
|
|
|
|
|
|
@@ -80,12 +79,11 @@ VALUES
|
|
if ($conn->query($sql) === TRUE) {
|
|
if ($conn->query($sql) === TRUE) {
|
|
print "Saved.";
|
|
print "Saved.";
|
|
$result = "OK";
|
|
$result = "OK";
|
|
-} else {
|
|
+ }
|
|
|
|
+else {
|
|
print "Error: " . $sql . "<br>" . $conn->error;
|
|
print "Error: " . $sql . "<br>" . $conn->error;
|
|
$result = "Error: " . $conn->error;
|
|
$result = "Error: " . $conn->error;
|
|
-}
|
|
+ }
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
$date = date('Y_m_d_H_i_s');
|
|
$date = date('Y_m_d_H_i_s');
|