Indefined Variable

Indefined Variable

am 17.04.2008 22:09:07 von TaylorMade

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_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;
}
}

Re: Indefined Variable

am 18.04.2008 03:11:15 von Jerry Stuckle

TaylorMade wrote:
> 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_VARS['username'])."\n".
>
> The $HTTP_VARS is undefined. How do I define it?
>



How did you define it in the first place? AFAIK this never was a
predefined variable in PHP.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================