Jump to content

Include inside of sql data being echoed in


Sleeper

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.