I am trying to get it to fill in the $path variable with what is in $path. It seams eval does not work for this and it does not work on it's own. What can I do to make this work
$path="/home/sites/home"; $fp3=fopen ("location.inc","w")or die("unable to open file (location.inc)"); $str='<?'; fwrite($fp3,"$str \n"); $str='include("$path/inc/dataconf.inc");'; fwrite($fp3,"$str \n"); $str='include("$path/inc/lang.eng.inc");'; fwrite($fp3,"$str \n"); $str='include("$path/inc/function2.inc");'; fwrite($fp3,"$str \n"); MT> this is what the eval() command equates to MT> $str = "include("$path/inc/dataconf.inc");"; MT> that should make it clearer (??) MT> -----Original Message----- MT> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] MT> Sent: Friday, December 14, 2001 4:21 PM MT> To: php-general MT> Subject: [PHP] using eval MT> I keep getting this error when I use eval what am I missing MT> Parse error: parse error in c:\httpd\doc\install.php(6) : eval()'d code on MT> line 1 MT> $path="/home/sites/home"; MT> $fp3=fopen ("location.inc","w")or die("unable to open file (location.inc)"); MT> $str='include("$path/inc/dataconf.inc");'; MT> eval ("\$str = \"$str\";"); MT> fwrite($fp3,"$str \n"); -- Best regards, rdkurth mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]