confused about eval()

From: Date: Sun, 28 Jan 2001 19:44:21 +0000
Subject: confused about eval()
Groups: php.general 
Request: Send a blank email to php-general+get-37140@lists.php.net to get a copy of this message
I have searched the archives, php.net and zend.com, and cannot seem to come up with an answer as to why this isn't woking... I have the following code snippet stored in a database, and I'm trying to eval it with this line of code: $cVar = addslashes( $qrNews[$cContentField . "Text"] ); eval( "<? " . $cVar . " ?>" ); I've tried: eval( $cVar . " ?>" ); eval( "?> " . $cVar ); and I cannot get the code snippet to actually evaluate... here's the output I actually do get: TCE's Canvas Chat (Java Applet) if( !( $myFile = open( \"http://wizaerd.com/cgi-sys/mchat.cgi?channel=wizaerd.com\", \"r\" ))) { print( \"Cannot be opened\" ); exit; } while( !feof( $myFile )) { $myLine = fgets( $myFile, 255 ); print( $myLine . \" \" ); } fclose( $myFile ); Parse error: parse error in Unknown on line 0 the code in the database is correct cuz I can drop it into a PHP page and it runs as expected... Could somebody give me a hand with this? Thanx --- code as is in database ------- if( !( $myFile = open( "http://wizaerd.com/cgi-sys/mchat.cgi?channel=wizaerd.com", "r" ))) { print( "Cannot be opened" ); exit; } while( !feof( $myFile )) { $myLine = fgets( $myFile, 255 ); print( $myLine . "<BR>" ); } fclose( $myFile ); Joseph E. Sheble a.k.a. Wizaerd Wizaerd's Realm Canvas, 3D, Graphics, ColdFusion, PHP, and mySQL http://www.wizaerd.com =================================

« previous php.general (#37140) next »