Sleeper Posted March 17, 2011 Share Posted March 17, 2011 Ok I am not sure if this is possible but I hope someone out there can show me a way. I have a webpage with left content boxes that are looped in depending on the sql info. In one of the boxes the content of the box is going to be another page being pulled in. Now normally I would just put in the include ("page"); but its inside of an echo so you would end the echo do the include and then start the echo back up, however in this case its pulling in the coding from a variable so im a bit lost as to what to do now. The page would have something like... echo ' '.html_entity_decode(stripslashes($info[content])).' '; and the info content part is include("pages/paypalbox.php") I've tried making the variable '; include("pages/paypalbox.php"); echo' Hoping that would fix it but I should of known better, the variable is being pulled in so its not processing it as part of the first step coding and it isn't going to do anything other then print it out like text. So is there a way to make this work? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/230939-include-inside-of-sql-data-being-echoed-in/ Share on other sites More sharing options...
requinix Posted March 17, 2011 Share Posted March 17, 2011 Create another field in your database that holds the name of a PHP file to include. When displaying the website content, check if the field has a value. If so then include() the file specified, and if not then echo the content. If anyone tells you to use a four-letter function that rhymes with "decal", don't. Quote Link to comment https://forums.phpfreaks.com/topic/230939-include-inside-of-sql-data-being-echoed-in/#findComment-1188809 Share on other sites More sharing options...
Sleeper Posted March 17, 2011 Author Share Posted March 17, 2011 Great Idea. a little if else and isset and that did the trick. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/230939-include-inside-of-sql-data-being-echoed-in/#findComment-1188820 Share on other sites More sharing options...
Maq Posted March 17, 2011 Share Posted March 17, 2011 You can use ev... oh wait, nvm. Quote Link to comment https://forums.phpfreaks.com/topic/230939-include-inside-of-sql-data-being-echoed-in/#findComment-1188823 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.