----- Original Message -----
From: "Derek "Anti-Gremlin" Spranger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 14, 2001 6:09 PM
Subject: [SLUG] php question


here is what i have atm...

<?php
  $wfn = "main.$res.txt";
  $wbs = @fopen ($wfn, "r");
  if (!$wbs) { echo ("Unable to locate file requested. [Error
Line: 4]<br>\n"); return; }
  $wct = fread ($wbs, filesize ($wfn));
  echo ($wct + "\n");
  fclose ($wbs);
?>
-------------
try
$wfn = sprintf("main.%s.txt",$res);
as your first line instead and consider using php functions
like "readfile", "file" and file_exists instead of fopen and
fread
( they are simpler) .

The php-manual is very useful. http://www.php.net/docs.php

---Gareth Walters


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to