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

$fp3=fopen ("location.inc","w")or die("unable to open file (location.inc)");
fwrite($fp3,"$str \n"); 
fwrite($fp3,"$str \n"); 
fwrite($fp3,"$str \n"); 
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> 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]

Reply via email to