{ parent::__destruct(); } public function show() { $query_str = substr($this->input['q'], 1); $query_str = explode('?', $query_str); $query_str = $query_str[0]; if ($query_str) { $sql = 'SELECT url, id FROM ' . DB_PREFIX . "urls WHERE code='{$query_str}'"; $result = $this->db->query_first($sql); } if (!$result) { $url = ERROR_URL; } else { $url = $result['url']; $sql = 'UPDATE ' . DB_PREFIX . "urls set click_count = click_count + 1 WHERE id={$result['id']}"; $this->db->query($sql); } header('Location:' . $url); } /** * 无需验证授权 */ protected function verifyToken() { } } $out = new index(); $out->show();
<?php session_start(); require_once "../connection/connect.php"; require_once "../../models/index/index.php"; require_once "../../models/index/simpleImage.php"; $cnct = new cnct_class(); $cnx = $cnct->cnct(); $index_data['cnx'] = $cnx; $index = new index($index_data); $image = new simpleImage($index_data); $table = $_POST['table']; $Table = $index->capitalize($table); $keep_parent = ''; $index->show($_POST); if (isset($_POST['keep_parent'])) { $keep_parent = '&' . $_POST['keep_parent'] . '=' . $_POST[$_POST['keep_parent']]; } //var_dump($_FILES);die(); $data = array(); if (isset($_POST)) { foreach ($_POST as $key => $post) { if ($key != 'table' && $key != 'keep_parent') { //**************************** save schedule as array ******************************** if (strpos($key, 'schedule_') !== false) { // $setSchedule = true; // $schedule[substr($key, 9)] = $post; // } elseif (strpos($key, 'table_') !== false) {