I am using JS to hide and display divs. In order to set the initial stage to be hidden I am using CSS to do display: none...
Now what I want to do is rather than making an entry for each item is simply make one css entry for #hidden and set that display to none, from there I want to have divs...
For anyone who had a similar problem, this is how I solved it:
http://www.19.5degs.com/element/767.php#parsing_php
// turn on output buffering
ob_start();
// this parses the php code in out $php variable; this is the heart of our templating logic
eval(" ?>" . $body . "<? ");
//...
Can anyone still help with this? Ill try to get as specific as possible...
For every page on my site I use a MySQL DB to retrieve the page contents. I have a field for title, heading, and body. I use the echo funciton in php to show the text in each one of the fields.
In one of my body fields...
I have the following code inside the $body var - what is currently being echoed:
(text... yada yada)
<br>
require("test.php");
<br>
(more text... yada yada yada)
This is the var that I am using eval on
All it is is a simple
echo $body;
inserted into a table cell. $body refers to the mySQL data I fetch that is basically a text cell. In there I have the require that needs to exectute. Its litterally just require("test.php"); that I put there.
You could use javascrip to do an on select command, use that data to generate the other lists you want. I guess you could go about this by building a switch for all the case for the 2nd drop down and have different outputs based on different queries depending on what value was submitted before.
tried eval, but doesnt seem to work...
the body text is $db['body']; and inside that is require("test.php");
can you give me an example of what I would code to make the php execute?
thanks for your quick replys
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.