master
IoTcat 5 years ago
parent ce5f9eb9d8
commit 9d0c1b0a14
  1. BIN
      server/cn/home/www/api/www-api/logo.ico
  2. BIN
      server/cn/home/www/api/www-api/photo/logo.ico
  3. 13
      server/cn/home/www/api/www-api/words/index.php
  4. BIN
      server/cn/home/www/api/www-api/words/logo.ico
  5. 11
      server/cn/home/www/functions.php

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -0,0 +1,13 @@
<?php
include '../../../functions.php';
header('Access-Control-Allow-Origin:*');
$res = db__getData(db__connect("yulu"), "yulu", "wid", mt_rand(1,42));
echo json_encode(array("s" => $res[0]['words']));
yimian__log("log_api", array("api" => "words", "timestamp" => date('Y-m-d H:i:s', time()), "ip" => ip2long(get_ip()), "_from" => get_from(), "content" => $res[0]['words']));
die();

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -196,6 +196,12 @@ function db__connect($servername="",$username="",$password="",$dbname="")
$username = $GLOBALS['g_db_log_usrName'];
$password = $GLOBALS['g_db_log_psswd'];
$dbname = $GLOBALS['g_db_log_dbName'];
}elseif($servername == "yulu"){
$servername = $GLOBALS['g_db_serverName'];
$username = $GLOBALS['g_db_usrName'];
$password = $GLOBALS['g_db_psswd'];
$dbname = "yulu";
}
$conn = new mysqli($servername, $username, $password, $dbname);
@ -366,9 +372,10 @@ function db__antisql($str)
/*****log******/
function yimian__log($table, $val, $limit){
function yimian__log($table, $val, $index = ""){
db__pushData(db__connect("log"), $table, $val, $limit);
if($index != "") db__pushData(db__connect("log"), $table, $val, $index);
else db__pushData(db__connect("log"), $table, $val);
}

Loading…
Cancel
Save