コード例 #1
0
function outputErrorResponse($errorMessage)
{
    $errorArray = array("error" => $errorMessage);
    outputResponse($errorArray);
}
コード例 #2
0
    if (empty($_REQUEST['keywords_plural'])) {
        return 'Не указано слово во множественном числе';
    }
    if (!($url = makeValidAddress($_REQUEST['url']))) {
        return array('status' => 'warning', 'message' => "Некорректный адрес страницы {$_REQUEST['url']}");
    }
    if ($_REQUEST['start'] == 'true') {
        if (!createFile($_REQUEST['path_created_files'], $_REQUEST['file_name'])) {
            return "Ошибка создания файла {$_REQUEST['file_name']}";
        }
        createFile($_REQUEST['path_created_files'], "tmp_{$_REQUEST['keywords']}.data");
    }
    return getListURL($url, $_REQUEST['keywords'], $_REQUEST['keywords_plural'], $_REQUEST['keywords_name'], $_REQUEST['file_name'], $_REQUEST['path_created_files']);
}
if (isset($_REQUEST['action'])) {
    outputResponse(routingActions($_REQUEST['action']));
} else {
    ob_start();
    ?>
<!DOCTYPE>
<html lang="en">
    <head>
		<title>Parser keywords</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
		<style type="text/css">
			.log { overflow-y: auto;height: 100%; }
			.log a { font-weight: bold;text-decoration: underline; }
			.page-header { height: 350px;}
			.tab-content { margin-top: 20px; }
コード例 #3
0
ファイル: recommendation.php プロジェクト: naxrun/wecore
        $prep->fetch();
        $fromdb_affected_rows = $prep->num_rows;
        $prep->close();
        if ($fromdb_affected_rows > 0) {
            $system_allgood = TRUE;
        } else {
            $system_allgood = FALSE;
        }
    }
    // Prepare output
    if ($system_allgood == TRUE) {
        setResponseCode($response, 200);
        if (isset($fromdb_visitor_ip_page_category_recommendation) && !empty($fromdb_visitor_ip_page_category_recommendation)) {
            pushResponseData($response, 'site_log_v_ip_p_cat_recommendation', $fromdb_visitor_ip_page_category_recommendation);
        }
        if (isset($fromdb_visitor_uid_page_category_recommendation) && !empty($fromdb_visitor_uid_page_category_recommendation)) {
            pushResponseData($response, 'site_log_v_uid_p_cat_recommendation', $fromdb_visitor_uid_page_category_recommendation);
        }
    } else {
        setResponseCode($response, 400);
        pushResponseError($response, 'No rows returned.');
    }
} else {
    setResponseCode($response, 400);
    pushResponseError($response, 'No input was given.');
}
// Close the database connection
$db_con->close();
// Output response
outputResponse($response);