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>
    <li><a href="#" title="Highway & Toll Facilities">Highway & Toll
Facilities</a></li>
    <li><a href="#" title="Mass Transit">Mass Transit</a></li>
    <li><a href="<?php echo _root
?>/expertise/index.php?category=specialized_expertise&amp;content=Intermodal
&amp;side_content=our_work"
title="Intermodal">Intermodal</a></li>
    <li><a href="#" title="Public Policy">Public Policy</a></li>
    <li><a href="#" title="Mega-Projects">Mega-Projects</a></li>
    <li><a href="#" title="Infrastructure Renewal">Infrastructure
Renewal</a></li>
    <li><a href="#" title="International">International</a></li>
    <li><a href="#" title="Design-Build">Design-Build</a></li>
    <li><a href="#" title="Workouts">Workouts</a></li>
    <li><a href="#" title="Advanced Revenue Collection Systems">Advanced
Revenue Collection Systems</a></li>
    <li><a href="#" title="TIFIA">TIFIA</a></li>
    <li><a href="#" title="Corporate Alliances & Ancillary
Revenue">Corporate Alliances & Ancillary Revenue</a></li>
    <li><a href="#" title="Fare Policy">Fare Policy</a></li>
    <li><a href="#" title="Joint Development">Joint 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

Reply via email to