Ooops - I forgot the question... Freaking difficul thing to do (at least for me)

From: Date: Mon, 15 Jan 2001 02:44:42 +0000
Subject: Ooops - I forgot the question... Freaking difficul thing to do (at least for me)
Groups: php.general 
Request: Send a blank email to php-general+get-34541@lists.php.net to get a copy of this message
Hey Folks! I have the following situation: I store in a MySQL table part of the HTML code that is used to mount dinamically the pages of a web site. The file looks something like this: <? ... Database stuff ... include header.inc; PRINT THE CONTENT OF THE QUERY IN THE DATABASE (that is essentially HTML tags and text) include footer.inc; ?> Before I enter any data in the database I put HTML comments like this: <!-- TEXT --> before and after any text that appear as a result of the HTML formatting in the browser, like this: ... <div align=left class=bodytext><!-- TEXT -->This is a bogus text used in this example in this boring example.<!-- TEXT --></div> ... My idea was to create a parser later that would get this result from the database and, in an administration module that I create, let the user modify the text from the page without touching the HTML code. So let's say: <!-- TEXT --> Our companies operate under a very simple set of rules: <!-- TEXT --> <ul type="circle" compact> <li class="white"> <!-- TEXT --> We try always to offer superior products at competitive prices <!-- TEXT --> </li> <li class="white"> <!-- TEXT --> We work to develop proprietary technologies that will give us a competitive advantage <!-- TEXT --> </li> <li class="white"> <!-- TEXT --> We engage in new enterprises in a controlled and conservative manner <!-- TEXT --> </li> <li class="white"> <!-- TEXT --> We are committed to our employee&rsquo;s well being and professional development <!-- TEXT --> </li> </ul> Would appear in the browser like this: Our companies operate under a very simple set of rules: o We try always to offer superior products at competitive prices o We work to develop proprietary technologies that will give us a competitive advantage o We engage in new enterprises in a controlled and conservative manner o We are committed to our employee&rsquo;s well being and professional development But in the administration module all the text surrounded by the <!-- TEXT --> tag like this: <!-- TEXT --> We are committed to our employee&rsquo;s well being and professional development <!-- TEXT --> would become something like this: <!-- TEXT --> We are committed to our employee&rsquo;s well being and professional development &nbsp;<a href="edittext.php?pageid=X"><img src="images/edit_buttom.gif"></a> <!-- TEXT --> where the edit_buttom.gif would appear beside of each text that could be edited in that page. My question is how I can do that after I get the data from the database? I mean how I can make this admin module to work? Thank you in advance, Rom

« previous php.general (#34541) next »