[wp-hackers] Using eval within Wordpress for a function mixed with html

Chris chris.hearn01 at ntlworld.com
Mon Dec 1 21:58:19 GMT 2008


Hi
I want to evaluate the string below within myfunc() and return a result 
ready to drop into my home page (echo $s;)

For reasons I won't bore you with I want to store this fragment in a 
text file.
Have bashed my head with all sorts of variants, but cannot get eval() to 
work!

The bit that works directly in a page is this:
'<a rel="external nofollow" 
href="'.get_bloginfo('wpurl').'/juniors/mirror"><img 
src="/oldsite/images/junior/.thumbs/.mirror.jpg" alt="mirror.jpg" 
title="mirror.jpg" width="95%" /></a> <hr />';

How to use eval() to get the proper result from this type of thing:
Assuming I read the above fragment from a text file into variable $s

function myfunc($s)
eval('\$theresult= \$s;')
return $s;

So any help would be MUCH appreciated!

Best regards from the UK!
Chris


-- 

    ********************************************************************** 
    Chris Hearn 
    *Tel:* 01625 827589 
    *Mob:* 07768 725141 
    *email:* chris.hearn01 at ntlworld.com 
    ********************************************************************** 
    The information transmitted is intended only for the person or entity 
    to which it is addressed and may contain confidential and/or privileged 
    material. Any review, retransmission, dissemination or other use of, 
    or taking of any action in reliance upon, this information by persons 
    or entities other than the intended recipient is prohibited. 
    If you received this in error, please contact the sender and delete the 
    material from any computer. 
    ********************************************************************** 



More information about the wp-hackers mailing list