Hello guys,
I am a new programmer and i am building a new website. I would like to give me your advice for the following problem:
I want to build a webpage, in which there will be a <div id="book-content"> ...............</div> part. Inside this div i would like
to dynamically display pages from a book. Each page will have text, scripting code blocks, blocks with the output of each scripting code, and images.
There will be a bar on the left of the webpage in which the user can select which page of the book he wants to load.
For example...My web page will look something like this...
<HTML>
<HEAD>
</HEAD>
<BODY>
<DIV ID="PAGE-HEADER">
//LOGO OF THE WEB PAGE
</DIV>
<DIV ID="PAGE-MENU">
//PAGE MENU
</DIV>
<DIV ID="BOOK-INDEX" WITH FLOAT:LEFT >
//HERE A WILL SHOW THE CHAPTERS OF THE BOOK AND THE PAGES OF EACH CHAPTER
</DIV>
<DIV ID="BOOK-PAGE">
//THE PAGE SELECTED FROM THE PREVIOUS 'BOOK-INDEX' MENU WILL BE DISPLAYED HERE WITH A MYSQL QUERY
******
</DIV>
</BODY>
</HTML>
Then in a mysql database, i would like to have records with a text field, that will contain for example the followng:
<h1> Chapter 1: bla bla </h1>
<p> in this chapter we will speak about bla bla bla.... </p>
<div id="code">
int main()
{
int x,y;
x=2;
y=3;
x=x+y;
}
</div>
<p> this will outpout the following:</p>
<div id="code output">
x=5!
</div>
I would like to get this html code from the database, and then show it in the <div id=BOOK-PAGE> div.
But i dont want to use php eval().
Also, if i store the code to a file and then include it, i will have too may files(equal to the book's number of pages etc 100).
Any ideas?