#1
  1. No Profile Picture
    mrtesting
    Guest
    Devshed Newbie (0 - 499 posts)
    Help . what is all these warnings mean ?
    how do i define them ?

    Warning: Undefined variable: act in /var/apache/www/ramond/Suggestion/main2.php on line
    301
    > Warning: Undefined variable: catid in /var/apache/www/ramond/Suggestion/main2.php on
    line 305
    > Warning: Undefined variable: cattitle in /var/apache/www/ramond/Suggestion/main2.php
    on line 306
    > Warning: Undefined variable: sortitem in /var/apache/www/ramond/Suggestion/main2.php
    on line 307
    > Warning: Undefined variable: searchtext in
    /var/apache/www/ramond/Suggestion/main2.php on line 308
    > Warning: Undefined variable: whichfield in
    /var/apache/www/ramond/Suggestion/main2.php on line 310
    >
  2. #2
  3. No Profile Picture
    cheny
    Guest
    Devshed Newbie (0 - 499 posts)
    Do this

    if (empty($act))
    $act = "";

    if (empty($catid))
    $catid = "";

    and etc..

    Always make sure to check if a variable is empty before setting it to null
  4. #3
  5. No Profile Picture
    scollo
    Guest
    Devshed Newbie (0 - 499 posts)
    In addition to empty(), take a look at the isset() function. Be aware that they look like opposites, but they're not exact opposites. A variable holding an empty string would return true for both.

    http://www.php.net/manual/ref.var.php3

    -- Chris

Similar Threads

  1. Passing POST variables
    By rlorenzo in forum PHP Development
    Replies: 11
    Last Post: June 6th, 2004, 03:00 PM
  2. help with assigning variables, variable passing/ retrieval
    By pinkipodmini in forum PHP Development
    Replies: 0
    Last Post: February 13th, 2004, 10:40 PM
  3. Replies: 2
    Last Post: February 11th, 2004, 12:03 AM
  4. functions and variables
    By uniopp in forum PHP Development
    Replies: 7
    Last Post: September 25th, 2003, 10:43 AM
  5. Replies: 3
    Last Post: September 23rd, 2003, 04:36 PM

IMN logo majestic logo threadwatch logo seochat tools logo