[PHP] making php code from db work
Greetings All, I pull the following snippet of code directly from a MySQL database: ul lia href=# title=Highway Toll FacilitiesHighway Toll Facilities/a/li lia href=# title=Mass TransitMass Transit/a/li lia href=?php echo _root ?/expertise/index.php?category=specialized_expertiseamp;content=Intermodalamp;side_content=our_work title=IntermodalIntermodal/a/li lia href=# title=Public PolicyPublic Policy/a/li lia href=# title=Mega-ProjectsMega-Projects/a/li lia href=# title=Infrastructure RenewalInfrastructure Renewal/a/li lia href=# title=InternationalInternational/a/li lia href=# title=Design-BuildDesign-Build/a/li lia href=# title=WorkoutsWorkouts/a/li lia href=# title=Advanced Revenue Collection SystemsAdvanced Revenue Collection Systems/a/li lia href=# title=TIFIATIFIA/a/li lia href=# title=Corporate Alliances Ancillary RevenueCorporate Alliances Ancillary Revenue/a/li lia href=# title=Fare PolicyFare Policy/a/li lia href=# title=Joint DevelopmentJoint Development/a/li /ul As you can see in line three, I use the following PHP code there: ?php echo _root ? Unfortunately when this is loaded into the PHP page this bit of code is not parsed and the link still includes the code snippet. Is there a way I can make this work or would it be better to build this nav tree in a more robust fashion such as loading the li one by one in a for loop for example? Thanks in advance. -- Kind Regards Schalk Neethling Web Developer.Designer.Programmer.President Volume4.Business.Solution.Developers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] making php code from db work
Hi! On Fri, 17 Mar 2006 12:07:42 +0200 Schalk wrote: Greetings All, I pull the following snippet of code directly from a MySQL database: [ . . . ] lia href=?php echo _root ?/expertise/index.php? category=specialized_expertiseamp;content=Intermodalamp;side_content=our_work title=IntermodalIntermodal/a/li [ . . . ] As you can see in line three, I use the following PHP code there: ?php echo _root ? Unfortunately when this is loaded into the PHP page this bit of code is not parsed and the link still includes the code snippet. Is there a way I can make this work or would it be Hmm.. I wanted to say check http://www.php.net/eval but then again, someone very famous in this group once said: If eval() is the answer, you're almost certainly asking the wrong question. So, maybe, I shouldn't even recommend that. (^_-) Try: http://www.google.com/search?q=parsing+php+code+db better to build this nav tree in a more robust fashion such as loading the li one by one in a for loop for example? Maybe that one's better. Thanks in advance. HTH, - Edwin - -- A wise person will listen and take in more instruction. - Proverbs 1:5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] making php code from db work
The only two ways I can think this could work is you must either write the output to a file with a php extension and then include that file, or you must set up the apache server to parse html files in the same way as it does php files. Just doing a normal output on a standard server won't recognise any server-side script in that output (which is what you've already experienced). Arno DotContent Professional Content Management Solutions -Original Message- From: Schalk [mailto:[EMAIL PROTECTED] Sent: 17 March 2006 12:08 To: php-general@lists.php.net Subject: [PHP] making php code from db work Greetings All, I pull the following snippet of code directly from a MySQL database: ul lia href=# title=Highway Toll FacilitiesHighway Toll Facilities/a/li lia href=# title=Mass TransitMass Transit/a/li lia href=?php echo _root ?/expertise/index.php?category=specialized_expertiseamp;content=Intermodal amp;side_content=our_work title=IntermodalIntermodal/a/li lia href=# title=Public PolicyPublic Policy/a/li lia href=# title=Mega-ProjectsMega-Projects/a/li lia href=# title=Infrastructure RenewalInfrastructure Renewal/a/li lia href=# title=InternationalInternational/a/li lia href=# title=Design-BuildDesign-Build/a/li lia href=# title=WorkoutsWorkouts/a/li lia href=# title=Advanced Revenue Collection SystemsAdvanced Revenue Collection Systems/a/li lia href=# title=TIFIATIFIA/a/li lia href=# title=Corporate Alliances Ancillary RevenueCorporate Alliances Ancillary Revenue/a/li lia href=# title=Fare PolicyFare Policy/a/li lia href=# title=Joint DevelopmentJoint Development/a/li /ul As you can see in line three, I use the following PHP code there: ?php echo _root ? Unfortunately when this is loaded into the PHP page this bit of code is not parsed and the link still includes the code snippet. Is there a way I can make this work or would it be better to build this nav tree in a more robust fashion such as loading the li one by one in a for loop for example? Thanks in advance. -- Kind Regards Schalk Neethling Web Developer.Designer.Programmer.President Volume4.Business.Solution.Developers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php