Still Racking My Brain
From: Stiano_at_Optonline.Net (stiano_at_optonline.net)
Date: 12/30/03
- Next message: Charlie Fiskeaux II: "creating a very simple cms with one login and one mySQL database"
- Previous message: Richard Davey: "Re: [PHP] Still Racking My Brain"
- Next in thread: Richard Davey: "Re: [PHP] Still Racking My Brain"
- Reply: Richard Davey: "Re: [PHP] Still Racking My Brain"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: php-general@lists.php.net Date: Tue, 30 Dec 2003 10:24:04 -0500
Okay, I got my pathname straightened out, but I'm still showing the
"unexpected $" message.
But that's after doing $[var name] = $_POST['var name']; for everything
with a $ in front of it. Can someone please let me know what I'm not
understanding here?
The code is, again, below.
Thank you very much.
Steve Tiano
-------------------------------------------
// image index
// generates an index file containing all images in a particular directory
//point to whatever directory you wish to index.
//index will be written to this directory as imageIndex.html
$dirName = "c:/csci/mm";
$dp = opendir($dirName);
chdir($dirName);
//add all files in directory to $theFiles array
while ($currentFile !== false){
$currentFile = readDir($dp);
$theFiles[] = $currentFile;
} // end while
//extract gif and jpg images
$imageFiles = preg_grep("/jpg$|gif$/", $theFiles);
$output = "";
foreach ($imageFiles as $currentFile){
$output .= <<<HERE
<a href = $currentFile>
<img src = "$currentFile"
height = 50
width = 50>
</a>
HERE;
} // end foreach
//save the index to the local file system
$fp = fopen("imageIndex.html", "w");
fputs ($fp, $output);
fclose($fp);
//readFile("imageIndex.html");
print "<a href = $dirName/imageIndex.html>image index</a>\n";
?>
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
- Next message: Charlie Fiskeaux II: "creating a very simple cms with one login and one mySQL database"
- Previous message: Richard Davey: "Re: [PHP] Still Racking My Brain"
- Next in thread: Richard Davey: "Re: [PHP] Still Racking My Brain"
- Reply: Richard Davey: "Re: [PHP] Still Racking My Brain"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|