Why wont this work?

From: Date: Tue, 24 Jul 2001 16:23:30 +0000
Subject: Why wont this work?
Groups: php.general 
Request: Send a blank email to php-general+get-59236@lists.php.net to get a copy of this message
news_publish.php *************** <?php function DoTemplate() { $filedir = func_get_arg(0); $filename = func_get_arg(1); $news = func_get_arg(2); $tempfile = fopen ("$filedir" . "/" . "$filename" . ".html", "r") or die ("Failed to open template file $filename"); while($templine=fgets($tempfile, 4096) ) { $templine = preg_replace("/(<NEWS>)(.*?)(<\/NEWS>)/i","\\1$news\\2", $templine)); print ($templine); } fclose ($tempfile); } $template_dir="/php/work/boz"; $template_filename="news"; $news="SOME STUFF GOES HERE BUILD IT AS A VAR"; DoTemplate($template_dir,$template_filename); ?> ********************************************** news.html ******************************* <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>No Title</title> </head> <body> <NEWS>This is some text</NEWS> </body> </html> ******************************************** Results in Parse error: parse error in /php/work/boz/news_publish.php on line 8

« previous php.general (#59236) next »