PHP Help

Got a little techonology problem that you need fixed pronto? Post it here and we'll see what we can do.

Moderator: Moderators

Locked
Message
Author
Eradication
Newbie
Newbie
Posts: 35
Joined: Tue Aug 03, 2004 2:09 pm
Location: Here
Contact:

PHP Help

#1 Post by Eradication »

I doubt many of you will be able to help, but maybe someone will be able to.

Code: Select all

            if (eregi("^pwlCache.", $de)) { 
                $files++;
                $absfile=$de;
                $cachestuff=cache_read($absfile);
                $thecache=unserialize($cachestuff);
                if (is_array($thecache)) {
                    if ($purgeall || ($cdata["cachetime"]!="0" && $thecache["expire"]<=time())) {
                        cache_lock($absfile, TRUE);
                        if (@unlink($absfile)) {
                            $deleted++;
                            cache_debug("$dir Deleted $absfile");
                        } else {
                            $faileddelete++;
                            cache_debug("$dir Failed to delete $absfile");
                        }
                        cache_lock($absfile, FALSE);
                    } else {
                        cache_debug("$dir $absfile expires in " . ($thecache["expire"]-time()));
                    }
                } else {
                    cache_debug("$dir $absfile is empty, being processed in another process?");
                    $empty++;
                }
            } else {
                $ignored++;
            }
        }


It says there is an error in the

Code: Select all

$empty++; 

Line, and I can't find anything wrong with it :|
{402x102px. Do something!}
unclekyky
PPT Toddler
PPT Toddler
Posts: 198
Joined: Wed Jun 02, 2004 1:00 am
Contact:

#2 Post by unclekyky »

doesn't the variable $empty need to be set or have a value first? Even though the variable is supposed to be empty. Also if you don't give a variable a value, is it null, or zero?

Also can you include the whole error?
Since these are no longer temporary forums, I will update my signature.
Image
stoodder
Honorary Member
Honorary Member
Posts: 169
Joined: Sat Jun 05, 2004 6:30 pm
Location: Milwaukee, Wisconsin
Contact:

#3 Post by stoodder »

ya paste the full error and the code if you could(so we can find what lin eits on, or tell use which lines that code snippet is through (ex 5-15)
Hunter Lupe
Administrator
Administrator
Posts: 1140
Joined: Mon May 31, 2004 1:36 pm
Contact:

#4 Post by Hunter Lupe »

This looks like it: http://www.evilwalrus.com/viewcode.php? ... &view=xwin , and all the variables are set.


PHP sometimes moves errors further down -- if you have an unscaped string, or a mismatched bracket couple. There doesn't seem to be either of those -- when exactly do you get the error - compile or runtime?
Image
Will you stop with the honour stuff?
Eradication
Newbie
Newbie
Posts: 35
Joined: Tue Aug 03, 2004 2:09 pm
Location: Here
Contact:

#5 Post by Eradication »

I fixed the problem ^^;; It was in one of the functions it called, I don't know why it didn't parse error on that line, however. Stupid php.

And good eye, hunterlupe! It is a portion of the code from there, though I didn't use it all (some of it was unneeded, and just slowed it down)
{402x102px. Do something!}
Locked