I 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_VAR S['username'])."\n".
The $HTTP_VARS is undefined. How do I define it?
function check_course_ac cess($course)
{
$account = new Account_Obj(arr ay());
if ($account->q_priv(array(' Production',
'Accounting'))) {
return true;
}
$sql = "SELECT * FROM demo\n".
"WHERE uid=".$account-
" AND CURRENT_TIMESTA MP < \"end\"";
$res = db_exec($sql);
if (db_numrows($re s) 0) {
$sql = "SELECT id FROM lessons\n".
" WHERE
courses.name='" .db_format($cou rse)."'\n".
" AND course_id=cours es.id\n".
" AND demo='t'";
$res = db_exec($sql);
if (db_numrows($re s) 0) {
return true;
}
}
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_VAR S['username'])."\n".
The $HTTP_VARS is undefined. How do I define it?
function check_course_ac cess($course)
{
$account = new Account_Obj(arr ay());
if ($account->q_priv(array(' Production',
'Accounting'))) {
return true;
}
$sql = "SELECT * FROM demo\n".
"WHERE uid=".$account-
>q_id($HTTP_VAR S['username'])."\n".
$res = db_exec($sql);
if (db_numrows($re s) 0) {
$sql = "SELECT id FROM lessons\n".
" WHERE
courses.name='" .db_format($cou rse)."'\n".
" AND course_id=cours es.id\n".
" AND demo='t'";
$res = db_exec($sql);
if (db_numrows($re s) 0) {
return true;
}
}
Comment