Re: [請益] 想問一題面試可能會考的問題
※ 引述《ThirdEmpire (我操你姐的國家暴力)》之銘言:
: 忘記在哪邊看到的…
: <?php
: $search_author = $HTTP_GET_VARS['search_author'];
不要在使用 HTTP_GET_VARS
// PHP5 with register_long_arrays off?
if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') ||
@ini_get('register_long_arrays') == '0' ||
strtolower(@ini_get('register_long_arrays')) == 'off'))
{
$HTTP_POST_VARS = $_POST;
$HTTP_GET_VARS = $_GET;
$HTTP_SERVER_VARS = $_SERVER;
$HTTP_COOKIE_VARS = $_COOKIE;
$HTTP_ENV_VARS = $_ENV;
$HTTP_POST_FILES = $_FILES;
// _SESSION is the only superglobal which is conditionally set
if (isset($_SESSION))
{
$HTTP_SESSION_VARS = $_SESSION;
}
}
: $result = mysql_query("SELECT count(*) FROM USERS WHERE author=$search_author");
: echo "Hello, {$search_author}!";
: ?>
: 請問這段 code 哪邊有問題?
: 假設 mysql 的 connection 已經在別的地方建立了
--
PHP MVC CodeIgniter 繁體中文手冊: http://tinyurl.com/mduyv8
PHP MVC CodeIgniter 繁體中文討論區:http://tinyurl.com/yayzoz8
PHP MVC CodeIgniter 中文官方網站: http://tinyurl.com/yatds8n
Appleboy Blog 電腦技術: http://blog.Wu-Boy.com
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.107.202
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
0
18