Indefined Variable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TaylorMade

    Indefined Variable

    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-
    >q_id($HTTP_VAR S['username'])."\n".
    " 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;
    }
    }
  • Jerry Stuckle

    #2
    Re: Indefined Variable

    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_VAR S['username'])."\n".
    >
    The $HTTP_VARS is undefined. How do I define it?
    >
    <code snipped>

    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@attgl obal.net
    =============== ===

    Comment

    Working...