I need to get a list of files in a directory, which then drops each filename into a html template, and then saves it as a new file.
So, image1.jpg that's in the directory is then added into a html template, and then saved as image1.htm
Is this possible?
Yes

I'm pretty rushed at the moment...I'll try and knock up some example code for you tonight.
I know that Techno is very busy at the moment (chasing pigs again?) so here's something I knocked up very quickly:
<?php
$images_dir = 'images/'; $html_dir = './';
$template = '';
// Look for a .csv file $d = dir($images_dir); while (false !== ($entry = $d->read())) {
$path = $images_dir . $entry;
if( !is_dir( $path ) ){
$pathinfo = pathinfo( $entry );
$fp = fopen( $pathinfo[ 'filename' ] . '.html', 'w' );
fwrite
(
$fp,
str_replace
(
'[[image_path]]',
$path,
$template
)
);
fclose( $fp );
}
}
?>
which shows the basic idea.
Thanks Stickman. I'll try that.
I'm trying to automate the creation of my businesscards and email stationary for clients - so I simply provide a client with a text file that they populate. So any mistakes in the businesscards' details is cause of client error.