note 16806 added to function.eval

From: Date: Wed, 14 Nov 2001 13:56:47 +0000
Subject: note 16806 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-20829@lists.php.net to get a copy of this message
how to get this working... I have insertet this into af mysql-tabel : <?php $string = 'cup'; $name = 'coffee'; $str = 'This is a $string with my $name in it.<br>'; echo $str; eval ("\$str = \"$str\";"); echo $str; ?> now I load this data from a script and want to run it. but it doessn't seem to work with eval($a); where $a is obtained by $a=mysql_result($result,0,"fieldname") however, if the field contain normal html chracters it works by just writin print $a or echo $a but what can i do, if i want to run the above written phpcode (wich is stores in a database field?? i have trided by eval($a); but this gives an error. samir -- http://www.php.net/manual/en/function.eval.php http://master.php.net/manage/user-notes.php?action=edit+16806 http://master.php.net/manage/user-notes.php?action=delete+16806 http://master.php.net/manage/user-notes.php?action=reject+16806

« previous php.notes (#20829) next »