hi guys, i've pieced this together from a buch of different sources and keep getting parse errors.. .it's driving me nuts. i'm trying to allow people to create new files based on a template which they can later edit using a perl script but i want to make sure the file names they create are valid. any ideas why this code is bunk? better ways to do this? many thanks :0)
<?PHP
$source = "/home/uac/public_html/routes/$template";
$template = "rtemplate";
$destination = "/home/uac/public_html/routes/temp/$file_name";
if (eregi("[_a-z0-9-]+(.[code=html]+)*$",$file_name)) {
copy ($source, $destination)
} else {
print "please be sure to enter a file name using letters and numbers only, making sure to include the '.html'. Underscores are ok.";
} endif
?>
<FORM action="<?php echo $PHP_SELF; ?>" method="post">
<INPUT type="text" name="file_name" size="30">
<INPUT type="submit" value="Make It!" name="submit">
</form>