Posted by Scott on 03/09/06 23:52
I'm not sure I understand why you're trying to use eval in this
situation. Wouldn't this give you the result you're after?
$teststr = '<a href="www.test.com">This is test 2</a>';
echo $teststr;
Scott
sunnyboy@europe.com wrote:
> Hi
>
> I'm currently trying to put some HTML code into a variable and to use
> it later.
> Any ideas, why TEST1 in the following example displays a link, while
> TEST2 only displays a text?
>
> Any help appreciated.
>
> <html>
> <head>
> </head>
>
> <body>
>
> <!-- TEST1 -->
> <a href=\"www.test.com\">this is test1</a>
>
> <br><br>
>
> <!-- TEST2 -->
> <?
> $teststr="?><a href=\"www.test.com\">this is test2</a><?php";
> eval($teststr);
> ?>
>
> </body>
> </html>
>
[Back to original message]
|