PHP problem

Jul. 1st, 2004 03:57 pm
chicken: (Default)
[personal profile] chicken
Why does this 'if' statement work:
$filesize = filesize($inputFile);
if ($filesize > 0) {
  //print "<br/>debug, $inputFile is $filesize\n";
  $result = xslt_process($xh, $inputFile, "searchResults.xsl");
  return $result;
}


When this 'if' statement does not:
if (filesize($inputFile) > 0) {
  //print "<br/>debug, $inputFile is $filesize\n";
  $result = xslt_process($xh, $inputFile, "searchResults.xsl");
  return $result;
}


ARGH! WTF? Am I thinking in Perl here or something?

(no subject)

Date: 2004-07-01 01:08 pm (UTC)
From: [identity profile] paulv.livejournal.com
I guess this could be a precedence issue? Maybe try
if ( (filesize($inputFile)) > 0 ). I'm not convinced this is right, though. I abhor PHP.

(no subject)

Date: 2004-07-01 01:19 pm (UTC)
jwgh: (Default)
From: [personal profile] jwgh
I dunno, but you could try putting in

if (filesize($inputFile) > 0) {
  [stuff]
} else {
  print filesize($inputfile);
  print filesize($inputfile) > 0;
}


or something. (Syntax is probably not correct.)

(no subject)

Date: 2004-07-01 04:41 pm (UTC)
From: [identity profile] mmcirvin.livejournal.com
You're still using $filesize in the second version, but you didn't define it.

(no subject)

Date: 2004-07-01 04:42 pm (UTC)
From: [identity profile] mmcirvin.livejournal.com
Oh, wait, you commented that line out, right? Were you trying it with the line uncommented?

Profile

chicken: (Default)
chicken

April 2009

S M T W T F S
   1234
56 78 9 1011
12131415161718
192021 22232425
2627282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags