ojsimon Posted January 14, 2008 Share Posted January 14, 2008 Hi i have a script that outputs html as a string echo htmlspecialchars( $grab->strip( $html, $config['show_tags'], $config['start_tag'], $config['end_tag'] how can i run this html code. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/85986-run-html-in-string/ Share on other sites More sharing options...
nikefido Posted January 14, 2008 Share Posted January 14, 2008 what does "run the code" mean exactly (in your words, it could mean a few things to me)? Quote Link to comment https://forums.phpfreaks.com/topic/85986-run-html-in-string/#findComment-439107 Share on other sites More sharing options...
ojsimon Posted January 14, 2008 Author Share Posted January 14, 2008 so that instead of the script displaying html code it displays the site that should be present with this code. thanks Quote Link to comment https://forums.phpfreaks.com/topic/85986-run-html-in-string/#findComment-439109 Share on other sites More sharing options...
ojsimon Posted January 15, 2008 Author Share Posted January 15, 2008 can anyone help please Quote Link to comment https://forums.phpfreaks.com/topic/85986-run-html-in-string/#findComment-440039 Share on other sites More sharing options...
kenrbnsn Posted January 15, 2008 Share Posted January 15, 2008 Don't use the function htmlspecialchars(), just echo the string: <?php echo $grab->strip( $html, $config['show_tags'], $config['start_tag'], $config['end_tag']); ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/85986-run-html-in-string/#findComment-440048 Share on other sites More sharing options...
tinker Posted January 15, 2008 Share Posted January 15, 2008 where do you want to run it? in another html page, save it via php, do you want to convert back what you've just converted? In a sense it's the web browser on the client side that 'runs' html code... Not sure what you mean? or as ken just said... Quote Link to comment https://forums.phpfreaks.com/topic/85986-run-html-in-string/#findComment-440049 Share on other sites More sharing options...
ojsimon Posted January 15, 2008 Author Share Posted January 15, 2008 this still doesnt work it just shows a blank page thanks Quote Link to comment https://forums.phpfreaks.com/topic/85986-run-html-in-string/#findComment-440055 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.