I am currently making a image info script. My problem is that when I try to link to this script from another file, it says there is an error on line 17, which is this line:
$fh = fopen("$cfile", "r+");
I've gone over this many times and I can't seem to figure out where my problem is.
$picutre is a variable that is given by the page that linked to the script. the value of $picture in this case is palmsmall.jpg
Plz help.
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
$cfile = basename($picutre) . ".dat";
if (!is_file($cfile))
{
touch ($picture . ".dat");
$fh = fopen("$cfile", "r+);
fwrite($fh, 1)
}
else
{
$fh = fopen("$cfile", "r+");
if (!$fh)
{
die("<BR>Failed to open file <I>$cfile</I>.");
}
$s = fgets($fh, 6);
$count = (int) $s;
$count = $count + 1;
$count = str_pad($count, 6);
rewind($fh);
fwrite($fh, $count);
fclose($fh);
?>