Indefined Variable
am 17.04.2008 22:09:07 von TaylorMadeI am doing a Migration of a site originally on php 4 now on 5.3. I am
getting tons of undefined indexes and undefined variables. I am
really just having trouble on the undefined variables. The line that
is giving me trouble is:
"WHERE uid=".$account->q_id($HTTP_VARS['username'])."\n".
The $HTTP_VARS is undefined. How do I define it?
function check_course_access($course)
{
$account = new Account_Obj(array());
if ($account->q_priv(array('Production',
'Accounting'))) {
return true;
}
$sql = "SELECT * FROM demo\n".
"WHERE uid=".$account-
>q_id($HTTP_VARS['username'])."\n".
" AND CURRENT_TIMESTAMP < \"end\"";
$res = db_exec($sql);
if (db_numrows($res) > 0) {
$sql = "SELECT id FROM lessons\n".
" WHERE
courses.name='".db_format($course)."'\n".
" AND course_id=courses.id\n".
" AND demo='t'";
$res = db_exec($sql);
if (db_numrows($res) > 0) {
return true;
}
}