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
Hi all -
I am building a custom content management system and needed some quick help.
I echo out the text for the body from my SQL DB. However in that I have a php include. How can I make it so that the echo escapes, executes the include and then continues with the text?
Thanks
I figured out the problem.
I must run the variables through an if statement first to make sure the null value gets assigned the last picked value.
Im an idiot.
:)
I have a game where the user picks 6 random numbers in different order, and then finally the sum of their differences are added to give a score. As an example, the user would pick the following 6 numbers in the following order (lowest to highest):
10, 12, 12, 14, 14, 14
What the script should...
Hi everyone I have a quick question regarding loops that I need help with...
I basically have a loop that runs 6 times for 6 GET vars, named v1 though v6. I want to run one loop that will print them back out and was wondering how to go about this.
The loop starts:
$i = 1;
while($i < 7){...
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.