Parsing PHP in .html Files

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Marty_
-


Joined: 21 Feb 2006
Posts: 55

PostPosted: Thu Jan 17, 2008 1:43 pm    Post subject: Parsing PHP in .html Files Reply with quote

I am trying to get php to work on html pages with little success, I have tried to adding the following :

Mine/Types
AddType application/x-httpd-php .php .htm .html

<?php echo "Testing!"; ?>

Has anyone any idea what else I could try or should the above have worked, am I missing something
Back to top View user's profile Send private message
rrinc
-


Joined: 24 Feb 2006
Posts: 725
Location: Arkansas, USA

PostPosted: Thu Jan 17, 2008 2:21 pm    Post subject: Reply with quote

Add html to the extensions (script paths) for the PHP interpreter.
_________________
-Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados.
Back to top View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Marty_
-


Joined: 21 Feb 2006
Posts: 55

PostPosted: Thu Jan 17, 2008 2:42 pm    Post subject: Reply with quote

rrinc wrote:
Add html to the extensions (script paths) for the PHP interpreter.


G's how did I miss that, so I guess I don't need to use the above

Thanks a million
Back to top View user's profile Send private message
Marty_
-


Joined: 21 Feb 2006
Posts: 55

PostPosted: Thu Jan 17, 2008 9:48 pm    Post subject: Reply with quote

nah didn't work or wont work rather.

For now I have left htm and html in with my php Associated Extensions & Script Paths

any other ideas ?

Some forums/blogs mention the following, but i dont see how i do this

Quote:
Parsing PHP in .html Files

Parsing PHP in web pages that end in .html or .htm, possible? Absolutely!

You're suddenly hosted on the Apache web server and perhaps you've just moved to a host that supports PHP and you want to try your hand at inserting cool PHP codes into them,

...you're probably thinking, Oh man, now I have to rename all my web pages to newpage.php!. Think again...

You may leave your web pages as index.htm or whatever.html and just start inserting your PHP codes inside it and have it parsed just as if they were placed in an index.php or whatever.php file!
Edit the .htaccess file

How? Well, here's what you should do:

Go to your WWW root, usually it looks like this -
path: /home/username/public_html

Look for the file named .htaccess. If it's not there, create a blank page using NotePad or Dreamweaver and save it as .htaccess

Now edit this file by adding the following lines:
code:

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

Save and close the .htaccess file. Upload it to your webserver (to your WWW root) and that's it!
Sample PHP code in a .html webpage

Now create a test file and filename it test.html

Copy the following html into it:
php:


<html>
<head></head>
<body>
<h1>
<?php echo "I LOVE PHP!"; ?>
</h1>
</body>
</html>

Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Fri Jan 18, 2008 10:38 am    Post subject: Reply with quote

It does work, so something you have done is stopping it. Did you put the MIME-type back to what it was originally?

You need to add htm and html to the scripting interpreter, like like you did with php, then restart the server and it will work.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sat Jan 19, 2008 4:11 pm    Post subject: Reply with quote

The instructions you found on the internet were for Apache.

Anyways, I'd recommend uninstalling and re-installing Abyss before you do this.

When declaring your PHP interpreter, add htm and/or html as an associated extension.

I tested it and this is all you need to do. No messing with MIMEs or anything like that.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Marty_
-


Joined: 21 Feb 2006
Posts: 55

PostPosted: Sat Jan 19, 2008 4:18 pm    Post subject: Reply with quote

Yeah sorry for not getting back, its my fault I should have mentioned its to parse php in templates html files which is something different. I'll keep trying different methods.
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sat Jan 19, 2008 6:56 pm    Post subject: Reply with quote

Marty_ wrote:
Yeah sorry for not getting back, its my fault I should have mentioned its to parse php in templates html files which is something different. I'll keep trying different methods.


Your best bet there is to do what I said before so that HTM and HTML files are parsed by PHP. Then, when you need to include your template files, change your code of your pages to this:

Code:
<?php
include("../template/top.htm");
?>


Would that work for you?
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Marty_
-


Joined: 21 Feb 2006
Posts: 55

PostPosted: Sat Jan 19, 2008 7:05 pm    Post subject: Reply with quote

You mean rename my html template page to .php and have the source call .php instead of html then place my php code into the page ?

I'll try it, cause it doesn't work the other way around.
Back to top View user's profile Send private message
Marty_
-


Joined: 21 Feb 2006
Posts: 55

PostPosted: Sat Jan 19, 2008 7:31 pm    Post subject: Reply with quote

Ok that didn't work whether thats what you meant I not sure, however heres where I am at.


My template pages are called for like this : FrontPage is only page I wanted to add php to.


Code:
sub InitializeTemplatesPaths{

   $Global{FrontPage_Template} = "$Global{Template_Dir}/FrontPage.html";


Heres the front page template, sorry it is a bit long.



Code:
<!--CLASS::Header-->
<div align="center"><center>
<table border="0" width="800" cellspacing="0" cellpadding="0" style="border-collapse: collapse">
<tr><td align="center" width="100%">
<!--CLASS::Top_Navigation-->
<!--CLASS::Top_Area-->
<!--CLASS::Welcome_Area-->
<!------------------------------------------------------------------------------------->
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="5" width="100%"><img src="<!--CLASS::Images_URL-->/dot1x1.gif" width="1" height="5" alt="" border="0"></td></tr></table>

<div  align="center">
<table border="0" align="center" valign="middle" width="100%" cellspacing="0" cellpadding="0">
<tr width="100%" >
<td width="5"><img src="<!--CLASS::Images_URL-->/dot1x1.gif" width="5" alt="" border="0"></td>


<td  width="220" align="center"valign="top">
 <table border="0" align="center" valign="middle" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse">


<tr>

    <td>
                                             
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="corner-box" width="220">

                                 
                                    <tr>
                                    <td align="center"><b><font size="3">[[services_title]]</font></b></td>
                                      </tr>
                                    </table>

   </td>
  </tr>
<tr><td width="100%">
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#C4C4C4" width="100%" >
      
      </table>
   </td></tr>

   <tr><td width="100%">
      <table border="0" cellspacing="0" cellpadding="1" style="border-collapse: collapse" bordercolor="#C4C4C4" width="100%">
<tr><td height="5"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_webbin--></td></tr>
           <tr><td width="100%" nowrap><center>  <a href="<!--CLASS::Advertiser_Login-->">[[advertiser_login]]</a></center></td></tr>
      </table>
   </td></tr>
      <tr><td width="100%" valign="top">
            <table border="0" cellspacing="0" cellpadding="5" style="border-collapse: collapse" bordercolor="#C4C4C4" width="100%">
            <tr><td>
            <table border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#C4C4C4" width="100%">

            <tr><td nowrap>[[categories_count]]</td><td nowrap align="right"><!--CLASS::Categories_Count--></td></tr>
            <tr><td nowrap>[[total_items_count]]</td><td nowrap align="right"><!--CLASS::Total_Items_Count--></td></tr>
            <tr><td nowrap>[[featured_home_count]]</td><td nowrap align="right"><!--CLASS::Featured_Home_Count--></td></tr>
            <tr><td nowrap>[[seconds_consumed]]</td><td align="right"><!--CLASS::Benchmark--></td></tr>
            <tr><td nowrap>[[who_is_online]]</td><td nowrap align="right"><!--CLASS::Whos_Online--></td></tr>
            <tr><td nowrap>[[who_is_online_users]]</td><td nowrap align="right"><!--CLASS::Whos_Online_Users--></td></tr>
            <tr><td nowrap>[[who_is_online_guests]]</td><td nowrap align="right"><!--CLASS::Whos_Online_Guests--></td></tr>

            </table>
            </td></tr>
            </table>
       </td></tr>
<tr>
 
   <td>
   <table border="0" cellpadding="0" cellspacing="0" width="100%" class="corner-box">
                                    <tr>
                                    <td height="25" align="center"><b><font size="3">[[sponsors_title]]</font></b></td>
                                      </tr>
                                    </table>
                             

   </td>
  </tr>
<tr>
<tr><td height="5"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_1--></td></tr>
<tr><td height="3"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_2--></td></tr>
<tr><td height="3"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_3--></td></tr>
<tr><td height="3"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_4--></td></tr>
<tr><td height="3"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_5--></td></tr>
<tr><td height="3"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_6--></td></tr>
<tr><td height="3"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_7--></td></tr>
<tr><td height="3"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_8--></td></tr>
<tr><td height="3"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_9--></td></tr>
<tr><td height="3"></td></tr>
<tr><td align="center"><!--CLASS::Banner:Link_10--></td></tr>
<tr><td height="10"></td></tr>


<tr><td align="center"><!--CLASS::Banner:Right_120--></td></tr>
<tr><td height="3"></td></tr>
   <tr><td align="center" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<td class="tbll"><img src="<!--CLASS::Images_URL-->/spacer.gif"  height="4" alt="" width="8"></td>
<td class="tblbot"><img src="<!--CLASS::Images_URL-->/spacer.gif"  height="4" alt="" width="8"></td>
<td class="tblr"><img src="<!--CLASS::Images_URL-->/spacer.gif"  height="4" alt="" width="8"></td>
</tr></table></td>

</td>
</td>
   </tr>
</td></tr>

   <!---------------------------------------------->
   </table>
</td>

<td width="5"><img src="<!--CLASS::Images_URL-->/dot1x1.gif" width="5" alt="" border="0"></td>

<td   align="center" valign="top">
   <table border="0" align="center" valign="top" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse">

        <tr><td align="center" width="100%">
               <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="600">
                 <tr>
                 </td></tr>
                 <tr><td>
                     <table border="0" cellpadding="0" cellspacing="0" width="100%" class="corner-box">



<tr><td align="left" valign="top"><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/16.gif" alt="Arts" border="0"></td>
<td class="Cats" valign="top"><a href="/Arts"><b>Arts</b></a>  <font color="#aaaaaa" size="1">(10247)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Arts/Movies">Movies</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Arts/Music">Music</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Arts/Television">Television</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/1.gif" alt="Business" border="0"></td>
<td class="Cats" valign="top"><a href="/Business"><b>Business</b></a>  <font color="#aaaaaa" size="1">(30637)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Business/Jobs">Jobs</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Business/Investing">Investing</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Business/Real_Estate">Real Estate</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/2.gif" alt="Computers" border="0"></td>
<td class="Cats" valign="top"><a href="/Computers"><b>Computers</b></a>  <font color="#aaaaaa" size="1">(12654)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Computers/Hardware">Hardware</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Computers/Internet">Internet</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Computers/Software">Software</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/3.gif" alt="Games" border="0"></td>
<td class="Cats" valign="top"><a href="/Games"><b>Games</b></a>  <font color="#aaaaaa" size="1">(3506)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Games/Gambling">Gambling</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Games/RPGs">RPG's</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Games/Video_Games">Video Games</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/4.gif" alt="Health" border="0"></td>
<td class="Cats" valign="top"><a href="/Health"><b>Health</b></a>  <font color="#aaaaaa" size="1">(6668)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Health/Alternative">Alternative</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Health/Fitness">Fitness</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Health/Medicine">Medicine</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table></td>
<td width="10"><img src="http://www.web-bin.com/images/dot1x1.gif" border="0" height="1" width="10"></td><td align="left" valign="top"><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/5.gif" alt="Home" border="0"></td>
<td class="Cats" valign="top"><a href="/Home"><b>Home</b></a>  <font color="#aaaaaa" size="1">(5012)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Home/Consumers">Consumers</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Home/Cooking">Cooking</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Home/Family">Family</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/6.gif" alt="Kids and Teens" border="0"></td>
<td class="Cats" valign="top"><a href="/Kids_and_Teens"><b>Kids and Teens</b></a>  <font color="#aaaaaa" size="1">(2726)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Kids_and_Teens/Arts">Arts</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Kids_and_Teens/School_Time">School Time</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Kids_and_Teens/Teen_Life">Teen Life</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/7.gif" alt="News" border="0"></td>
<td class="Cats" valign="top"><a href="/News"><b>News</b></a>  <font color="#aaaaaa" size="1">(1409)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/News/Media">Media</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/News/Newspapers">Newspapers</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/News/Weather">Weather</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/8.gif" alt="Recreation" border="0"></td>
<td class="Cats" valign="top"><a href="/Recreation"><b>Recreation</b></a>  <font color="#aaaaaa" size="1">(11121)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Recreation/Food">Food</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Recreation/Humor">Humor</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Recreation/Travel">Travel</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/9.gif" alt="Reference" border="0"></td>
<td class="Cats" valign="top"><a href="/Reference"><b>Reference</b></a>  <font color="#aaaaaa" size="1">(3541)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Reference/Education">Education</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Reference/Libraries">Libraries</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Reference/Maps">Maps</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table></td>
<td width="10"><img src="http://www.web-bin.com/images/dot1x1.gif" border="0" height="1" width="10"></td><td align="left" valign="top"><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/10.gif" alt="Regional" border="0"></td>
<td class="Cats" valign="top"><a href="/Regional"><b>Regional</b></a>  <font color="#aaaaaa" size="1">(1004)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Regional/Asia">Asia</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Regional/Europe">Europe</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Regional/Oceania">Oceania</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/11.gif" alt="Science" border="0"></td>
<td class="Cats" valign="top"><a href="/Science"><b>Science</b></a>  <font color="#aaaaaa" size="1">(8828)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Science/Biology">Biology</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Science/Math">Math</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Science/Physics">Physics</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/12.gif" alt="Shopping" border="0"></td>
<td class="Cats" valign="top"><a href="/Shopping"><b>Shopping</b></a>  <font color="#aaaaaa" size="1">(17626)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Shopping/Clothing">Clothing</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Shopping/Gifts">Gifts</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Shopping/Pets">Pets</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/13.gif" alt="Society" border="0"></td>
<td class="Cats" valign="top"><a href="/Society"><b>Society</b></a>  <font color="#aaaaaa" size="1">(10335)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Society/Issues">Issues</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Society/People">People</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Society/Religion">Religion</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table><table border="0" cellpadding="2" cellspacing="3">
<tbody><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td rowspan="2" valign="top"><img src="http://www.web-bin.com/images/14.gif" alt="Sports" border="0"></td>
<td class="Cats" valign="top"><a href="/Sports"><b>Sports</b></a>  <font color="#aaaaaa" size="1">(9333)</font></td>
</tr>
<tr><td valign="top"><font size="1"><a href="/Sports/Basketball">Basketball</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Sports/Rodeo">Rodeo</a> <!--Teaser_Category_Count--></font>, <font size="1"><a href="/Sports/Soccer">Soccer</a> <!--Teaser_Category_Count--></font>...</td></tr>

</tbody></table>
</td></tr>
</tbody></table></td></tr>


</td></tr>
                     

</table>
                 </td></tr>
               </table>
        </td></tr>


     
<tr><td align="center" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<td class="tbll"><img src="<!--CLASS::Images_URL-->/spacer.gif"  height="4" alt="" width="8"></td>
<td class="tblbot"><img src="<!--CLASS::Images_URL-->/spacer.gif"  height="4" alt="" width="8"></td>
<td class="tblr"><img src="<!--CLASS::Images_URL-->/spacer.gif"  height="4" alt="" width="8"></td>
</tr></table></td>


        <tr><td align="center" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="10" width="100%"><img src="<!--CLASS::Images_URL-->/dot1x1.gif" width="1" height="10" alt="" border="0"></td></tr></table></td></tr>

        <tr><td align="center" width="100%">
               <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="600">
                 <tr><td width="100%" height="20">
                     <table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse">
                        <tr> <td width="100%" height="20" nowrap><strong>[[featured_home_title]]</strong></b></td>
                     </table>
                 </td></tr>
                 <tr><td>
                     <table border="0" cellpadding="0" cellspacing="0" width="100%" class="corner-box">
                           <tr><td width="100%" bgcolor="#FFFFFF" align="center"><!--CLASS::Featured_Home_Listing--></td></tr>
                     </table>
                 </td></tr>
               </table>
        </td></tr>

   </table>
</td>

<td width="5"><img src="<!--CLASS::Images_URL-->/dot1x1.gif" width="5" alt="" border="0"></td>
</tr>
</table>
</div>
<!-------------------------------------------------->
<!--CLASS::Bottom_Navigation-->
<!--CLASS::Bottom-->
</td></tr>
</table>
</center></div>
<!--CLASS::Footer-->


The CLASS pages are sub pages like header or footer etc... I have tried placing a php include page into a class template but that don't work either.

I have added html & htm to my PHP interpreter extentions
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sat Jan 19, 2008 10:29 pm    Post subject: Reply with quote

Ahhh... I see you're using Perl to display your homepage, not just HTML. Coexisting with two interpreters on the same page could introduce a few difficulties.

What is the purpose of the PHP code you want in your templates?

PS You could run a PHP script from the command line through Perl. I have a Perl script on a PHP webpage, so it's kind of backwards from your setup, but I run the Perl script through PHP's system() command.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Marty_
-


Joined: 21 Feb 2006
Posts: 55

PostPosted: Sun Jan 20, 2008 2:31 pm    Post subject: Reply with quote

Instead of showing <!--CLASS::Featured_Home_Listing--> featured links(Editors choice) I wanted to show the latest world news from a free script called magpierss an example of use can been see here on another directory script http://www.linkpartnergold.com/ its the last block on that page and this is my perl(yes) website http://www.web-bin.com/
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sun Jan 20, 2008 10:51 pm    Post subject: Reply with quote

I've messed around with that script a little and it is true that you could call this script with Perl's system() command.

Just execute "c:\php\php.exe c:\htdocs\news.php" (with the appropriate paths, of course) in your Perl code.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Marty_
-


Joined: 21 Feb 2006
Posts: 55

PostPosted: Tue Jan 29, 2008 12:19 am    Post subject: Reply with quote

pkSML wrote:
I've messed around with that script a little and it is true that you could call this script with Perl's system() command.

Just execute "c:\php\php.exe c:\htdocs\news.php" (with the appropriate paths, of course) in your Perl code.


How can I implement that, I don't understand Perl very well, sorry

PS: thanks for help on this...
_________________
What is Pay Per Play ?
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Tue Jan 29, 2008 1:18 am    Post subject: Reply with quote

Marty_ wrote:
pkSML wrote:
I've messed around with that script a little and it is true that you could call this script with Perl's system() command.

Just execute "c:\php\php.exe c:\htdocs\news.php" (with the appropriate paths, of course) in your Perl code.


How can I implement that, I don't understand Perl very well, sorry

PS: thanks for help on this...


Code:
#!/usr/bin/perl

print "Content-type: text/html\n\n";

$ls_cmd = 'c:/php/php.exe c:/htdocs/news.php';
open(LS_CMD, "$ls_cmd |") or die "Can't run '$ls_cmd'\n$!\n";
$i=0;
while(<LS_CMD>){ # each line of output is put into $_
# this bit just illustrates how each line of output might be processed
    next if /^total/; # because we're only interested in real output
#    $ls_output[$i++] = $_; # save output line in the array
print $_;
}
[Source: http://www.tek-tips.com/faqs.cfm?fid=5198]

The system command you're running goes in $ls_cmd. In the while loop, it does something with each line of the output of the system command. We want the output of the PHP script to be printed to the Perl script output, hence the print $_ line.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group