Table Display Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jwgrafflin
    New Member
    • Mar 2008
    • 7

    #1

    Table Display Problem

    Pardon me for jumping in, but I, too am having a problem getting my data to display. Here's where the output should display
    link removed - moderatorand here's the code snippet:

    Code:
    <table>
      <tr> 
        <th>Host Name</th>
        <th>Established</th>
        <th>Price</th>
        <th>Disk Space</th>
        <th>Bandwidth</th>
        <th>Economy Plan Available</th>
        <th>Allows Mailing Lists</th>
        <th>Server Platform</th>
        <th>SSL Included</th>
        <th>eCommerce Ready</th>
        <th>Affiliate Program</th>
      </tr>
    
      <?php
      include("dbinfo.inc.php");
    		
      $query="SELECT * FROM webhosts ORDER BY hostname ASC";
      $result = mysql_query($query)or die(mysql_error());
      $num=mysql_numrows($result); 
      $i=0;
      mysql_close();
      while ($i < $num) {
      $hostname=mysql_result($result,$i,"hostname");
      $url=mysql_result($result,$i,"url");
      $established=mysql_result($result,$i,"established");
      $price=mysql_result($result,$i,"price");
      $diskspace=mysql_result($result,$i,"diskspace");
      $bandwidth=mysql_result($result,$i,"bandwidth");
      $econplan=mysql_result($result,$i,"econplan");
      $maillists=mysql_result($result,$i,"maillists"); 
      $platform=mysql_result($result,$i,"platform"); 
      $ssl=mysql_result($result,$i,"ssl"); 
      $ecommerce=mysql_result($result,$i,"ecommerce"); 
      $affiliate=mysql_result($result,$i,"affiliate");
      echo "<tr><td><a href='$url'>$hostname</a></td>
                    <td> $established </td>
    	<td> $diskspace </td>
    	<td> $bandwidth </td>
                    <td> $econplan </td>
    	<td> $maillists </td> 
    	<td> $platform </td> 
    	<td> $ssl </td> 
    	<td> $ecommerce </td> 
    	<td> $affiliate </td></tr>";
      ++$i;
      }
      ?>
    </table>
    Last edited by ronverdonk; Mar 15 '08, 10:18 AM. Reason: link removed
  • satas
    New Member
    • Nov 2007
    • 82

    #2
    Originally posted by jwgrafflin
    Here's where the output should display
    http://www.jwgmg.com/hosting/compare-hosts.html
    If you will have a look at the page's source you see the php code. That means you have to modify http.conf for parsing .htmlfiles as .php files :
    Code:
    AddType application/x-httpd-php .php .html

    Comment

    • jwgrafflin
      New Member
      • Mar 2008
      • 7

      #3
      Okay, I'm lost there. How do I do that?

      I'm looking at my Apache handler page right now. It shows

      System-wide defined Apache handlers

      .cgi .pl cgi-script
      .php .php4 .php3 application/x-httpd-php
      .shtml server-parsed

      To add a handler, it requires Handler name and Extensions.

      Tried adding AddType application/x-httpd-php .php .html to my .htaccess file, but it rendered an internal server error.

      Comment

      • satas
        New Member
        • Nov 2007
        • 82

        #4
        Try something like that:
        Code:
        .cgi .pl cgi-script 
        .php .php4 .php3 .html application/x-httpd-php 
        .shtml server-parsed
        If it does not works try google.

        Comment

        Working...