예제 #1
0
파일: index.php 프로젝트: anugool/php-news
require_once $base['dir'] . 'data/config.php';
require_once $base['dir'] . 'source/core.func.php';
require_once $base['dir'] . 'source/mysqldb.class.php';
$base['post'] = paddslashes($_POST);
$base['get'] = paddslashes($_GET);
$base['cookie'] = paddslashes($_COOKIE);
unset($_POST);
unset($_GET);
unset($_COOKIE);
$langset = $base['cookie']['lang'] ? $base['cookie']['lang'] : $config['lang'];
require_once $base['dir'] . 'lang/langset.php';
$langset = in_array($langset, array_keys($all_lang)) ? $langset : $base['cookie']['lang'];
require_once $base['dir'] . 'lang/' . $langset . '/all.lang.php';
$base['lang'] = $lang;
unset($lang);
$base['config'] = $config;
unset($config);
$db = new mysql_database();
if (!$db->connect($base['config']['db'])) {
    error_report($base['lang']['db_connect_error']);
}
if ($base['get']['mod'] == '') {
    $base['get']['mod'] = 'index';
}
if (!empty($_FILES)) {
    $base['get']['mod'] = 'upload';
}
if (!in_array($base['get']['mod'], array('index', 'upload', 'show', 'admin'))) {
    error_report(str_replace('\\1', '<code>' . htmlspecialchars($base['get']['mod']) . '</code>', $base['lang']['mod_not_found']));
}
require_once $base['dir'] . 'source/' . $base['get']['mod'] . '.mod.php';
예제 #2
0
<?php

include_once 'mysql_database.php';
include_once 'short_url.php';
$db = new mysql_database();
$url = new short_url();
$user_short_url = isset($_GET['short_code']) ? $_GET['short_code'] : '';
//take the $short_code from the url using the .htaccess file
$db->connect();
$url->selectUrl($user_short_url);
$db->close();