Extension Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Rider
Forum Newbie
Posts: 9
Joined: Sun Oct 06, 2002 3:56 am
Contact:

Extension Problem

Post by Rider »

Hey all. Thanks for the help in advance. Below is some info on my setup.

Win98, Apache 2.0, PHP 4.0

Attempting: To have a site with a header.inc and footer.inc.

I've done this before on web hosting servers but not on my own web server.

Problem: When I access 'index.php' it shows the html for 'index.php' but that is it. Not for the header/footer files.

A weird thing is that when I hit F5 it shows me the html coding for 'index.php'.

-Rider
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Can we see the code please?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

is

Code: Select all

<?php phpinfo(); ?>
working?
Rider
Forum Newbie
Posts: 9
Joined: Sun Oct 06, 2002 3:56 am
Contact:

Post by Rider »

Code: Select all

<?php require('header.inc'); ?>

Code: Select all

</td>
        <td width="7" bordercolor="#ffffff">&nbsp;</td>

    <td width="450" height="300" valign="top" bgcolor="#dddddd" bordercolor="#ffffff">


    <table border="1" cellpadding="1" cellspacing="0" width="100%" bordercolor="#000000">
      <tr bgcolor="#3366cc">
        <td><font face=arial color="#ffffff"><b>The Team USA News Desk</b></font></td>
      </tr>
    </table>

    <table border="0" cellpadding="2" cellspacing="3" width="100%" bordercolor="#000000">
      <tr bgcolor="#ffffff">
	<td bordercolor="#000000"><font face="arial" size="-1" color="#3366cc">New Building!<br>
Posted by Rider<br>
On 9/12/02<br>
<font color="#000000">That's right! We have a wonderful new building for you guys to play in and get used to. If you have any problems contact me.</td>
      </tr>
      <tr bgcolor="#ffffff">
	<td bgcolor="efefef"><font face="arial" size="-1" color="#3366cc">Team USA In Motion<br>
Posted by Rider<br>
On 9/12/02<br>
<font color="#000000">Jim Bleu: Welcome to Team USA TV! I am Jim Bleu alongside me is my lovely co-worker Kelly Smith. 
<p>
Kelly Smith: Hello and thanks for viewing Team USA TV. 
<p>
Jim Bleu: A lot has been going on with Team USA today. Rider met up with MBT to have a discussion about how Team USA was to be run. 
<p>
Kelly Smith: Rider had this to say. "What Team USA needs is some order. That way people know when to do something and there isn't any confusion to its wrestlers." 
<p>
Jim Bleu: Hmm. So, who is our superior now? 
<p>
Kelly Smith: I have no clue. I hope everyone likes to have a certain person to complain to. Rider also stated that there would be, "The right person to talk to about the right subject." 
<p>
Jim Bleu: Uh huh. I think we're out of time.
<p>
Kelly Smith: Nope. We're just going for a commercial break. </td>
      </tr>
      <tr bgcolor="#ffffff">
	<td>
<font face="arial" size="-1" color="#3366cc">Beginning Roster?<br>
Posted by Rider<br>
On 9/12/02<br>
<font color="#000000">Jim Bleu: Welcome back folks. Everyone here is still unclear of what the starting roster will be for Team USA. Big names from TUF will surely be expected. 
<p>
Kelly Smith: Indeed Jim. But, I hear they are having problems with a new contract for JBK. 
<p>
Jim Bleu: Oh, I doubt that. JBK has been here from the start. I am just shocked to see Rider making a come back.
<p>
Kelly Smith: It was a matter of timee before he came crawling back. 
<p>
Jim Bleu: Basically everyone, expects your favorites and not so favorites to hit the ring soon! 
<p>
Kelly Smith: I'm Kelly Smith, and I am leaving right along with Jim Bleu. 
<p>
Jim Bleu: Goodbye all. 
</font></td>
     </tr></tr>
    </table>

Code: Select all

<?php require('footer.inc'); ?>
I'm thinking that the extension '.inc' isn't one my system or something.

-Rider
User avatar
EvilWalrus
Site Admin
Posts: 209
Joined: Thu Apr 18, 2002 3:21 pm
Location: Springmont, PA USA

Post by EvilWalrus »

use include() rather than require()
Rider
Forum Newbie
Posts: 9
Joined: Sun Oct 06, 2002 3:56 am
Contact:

Post by Rider »

I changed 'require' to 'include' and still getting the exact same problem.

-Rider
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

As volka said, what do you get if you try and run a file containing:

Code: Select all

&lt;?php phpinfo(); ?&gt;
and you are trying to run the file from localhost (eg. http://localhost/myfile.php) not just double clicking on it?

Mac
Rider
Forum Newbie
Posts: 9
Joined: Sun Oct 06, 2002 3:56 am
Contact:

Post by Rider »

It acts like it is going to download 'test.php' from localhost. I just posted a new topic which probably explains why I am getting these problems.

-Rider
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

EvilWalrus wrote:use include() rather than require()
That doesn't really matter, one throws Warning when failure and other throws Fatal error, I use require rather than include :arrow:
Post Reply