eval on php embedded html

From: Date: Thu, 24 Jan 2002 13:36:39 +0000
Subject: eval on php embedded html
Groups: php.general 
Request: Send a blank email to php-general+get-81872@lists.php.net to get a copy of this message
hi folks, i'm having a problem using eval. i have some html code interdispersed with php code (proper statement not just variables) in a database. when i fetch the code and display it using : $reg_adv_html=addslashes($reg_adv_html); eval("\$reg_adv_html = \"$reg_adv_html\";"); $reg_adv_html=stripslashes($reg_adv_html); print "$reg_adv_html"; the variables work (their values are substitued), but my condtional staments don't work. example from $reg_adv_html : <TD valign="center"><input type="radio" name="radiobutton1" value="reg1" <? if ($radiobutton1=="on") { print "selected"; ?>> </TD> can someone tell me if i have to remove the <? ?> tags from the html? thanks very much! dk

« previous php.general (#81872) next »