代码拉取完成,页面将自动刷新
<?php
/***************************************
* http://www.program-o.com
* PROGRAM O
* Version: 2.6.3
* FILE: getbots.php
* AUTHOR: Elizabeth Perreau and Dave Morton
* DATE: MAY 17TH 2014
* DETAILS: Searches the database for all active chatbots, returning a JSON encoded array of ID/name pairs
***************************************/
$time_start = microtime(true);
$script_start = $time_start;
$last_timestamp = $time_start;
$thisFile = __FILE__;
require_once("config/global_config.php");
//load shared files
require_once(_LIB_PATH_ . 'PDO_functions.php');
include_once (_LIB_PATH_ . "error_functions.php");
include_once(_LIB_PATH_ . 'misc_functions.php');
ini_set('error_log', _LOG_PATH_ . 'getbots.error.log');
$dbConn = db_open();
$sql = "select `bot_id`, `bot_name` from `$dbn`.`bots`;";
$result = db_fetchAll($sql, null, __FILE__, __FUNCTION__, __LINE__);
$bots = array('bots'=>array());
foreach ($result as $row)
{
$bot_id = $row['bot_id'];
$bot_name = $row['bot_name'];
$bots['bots'][$bot_id] = $bot_name;
}
header('Content-type: application/json');
$out = json_encode($bots);
exit($out);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。