Jump to content

PHP parsing HTML pages problem


Nikodemz

Recommended Posts

I'll preface this by saying I'm no coder. I'm a systems admin who's been charged with getting a website to work properly and I'm learning the ins and outs of configuring PHP as I go. This may be a server config problem or a code problem so I thought I'd start by posting here.

Current config of server: (things are generally working just fine)
PHP 5
IIS 6.0
Windows Server 2003

PHP seems to be parsing .php files perfectly so I think the basic configuration of the server is setup correctly. The problem I'm running into involves parsing an .html page. The following code preceeds the header of index page of this particular website.

<?php
// include the header file which sets up all the connections etc needed for
// each page.
include_once('includes/header.php');

// get the front page info and put it into an array
$res = $db-query( 'SELECT * FROM frontpage' );
$fp = array();
while ( $row = mysql_fetch_array( $res ) ) {
$fp[$row['section']] = nl2br( $row['content'] );
}
?>

When I few the source of the page from a browser this code shows up, indicating that it hasn't been executed. That makes sense since by default I don't have PHP parsing .html pages. However, when I change that and make it so PHP does parse .html pages I get a blank page. I've created a test .html page that includes a one line PHP script that simply echos some text back. That page works just fine. So I have to assume that PHP is parsing .html pages correctly.

Is there something that this code is doing that requires additional tweaking of my php.ini? That's about all I can think of at this point. Unfortunately, I'm a novice when it comes to coding so I really can't tell what this snippet of code is trying to.

My hope is that I've supplied enough information for someone to at least point me in the right direction. I can certianly supply more information if necessary. Thanks in advance for any assistance.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.