Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 03-04-2009, 03:47 PM
jcmeyer5 jcmeyer5 is offline
Hatchling Croc
 
Join Date: Mar 2009
Posts: 2
Default PHP Include() - help?

Be gentle, I am an accountant, and my web page is for recreation, so I have no real training.

I was told that include() was a good way to update the navigation links on each page because you only have to edit one file vs. manually editing all 30 something pages of html I have now. So I was given the instructions on how to do it. Basically, build the PHP file with the HTML you want to include(), and use the command

<?php include("file.php"); ?>

to include the file. I did that... but it didnt work in any fashion. I have also downloaded examples from other websites, thrown them out there, and they didnt work either.

So what am I doing wrong? Is there some sort of setup I need to do first to make this work? Enable something? I really am not trying to do anything more complicated than update common content on web pages in less time than it takes now.

Thanks!

Jim
Reply With Quote
  #2  
Old 03-04-2009, 04:37 PM
eLIANT eLIANT is offline
King Croc
 
Join Date: Apr 2005
Posts: 836
Default Re: PHP Include() - help?

First, I'm assuming you *really* need php.

1 - The name of the file in which the "include statement" resides must end in *.php
2 - if there are any php statements in the "included" file, they must be enclosed in the php indicators ("<?php" and "?>")
__________________

eLIANT Technology Services
(site feedback welcome)
Reply With Quote
  #3  
Old 03-04-2009, 06:09 PM
jcmeyer5 jcmeyer5 is offline
Hatchling Croc
 
Join Date: Mar 2009
Posts: 2
Default Re: PHP Include() - help?

Yes... I REALLY needed it.

The problem was #1. I had it named html still and not php.

Thanks for your help!

Jim
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 03:00 AM.