|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
~ Ryan ~
|
PHP Include - Host has uneditable php.ini file
I'd like to use the PHP include(), but I am afraid that my hosts php.ini file does not contain the include_path option and I don't want to go editing the php.ini file as I am still learning my way through it and I don't want to mess it up too much.
I've read about using the PHP Code:
I've got one more question. When including a file with include()... do I have to specify the server, or will it take the file straight from the directory of the current html document? thanks, Ryan
__________________
RiotCats.com, an internet domain specifically fabricated and visually erected for the appreciation of the feline kingdom! |
|
|
|
|
|
#2 |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
Using
include("somefile.php"); doesn't work? I'm not sure about the ini file, but it'll take the file relative to the current file (no need to specify server). Also you mention "html document". You're not trying to run php from a .html file are you?
__________________
"It is the way of man to make monsters and it is the nature of monsters to destroy their makers." |
|
|
|
|
|
#3 |
|
~ Ryan ~
|
It's a .php file... which is what I think I'm supposed to use... but it still doesn't work like this:
PHP Code:
.EDIT: Now I'm getting this error : Parse error: parse error, unexpected T_INCLUDE in /home/content/r/p/a/rpassey/html/index4.php on line 2 Last edited by rspassey; 09-28-2006 at 09:30 PM. |
|
|
|
|
|
#4 |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
You don't need to edit the php.ini file even if you could. All the include file directive tells php is the default location to look for your included file. As long as you tell it where the include file is it is not necessary to change the php.ini file.
You are getting the parse error because you have a space between the ? and php. It should be <?php not <? php.
__________________
Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row |
|
|
|
|
|
#5 | |
|
~ Ryan ~
|
Quote:
![]() PHP seems to be a pretty picky language... I think I really should take a "class" on it. Thanks again, Ryan Edit.. one last question: is there a prefered file type for included headers and footers and what not? I'm using .inc right now, because that's what my php book shows me, but I've seen a few online tutorials using .php for their header. Last edited by rspassey; 09-28-2006 at 10:16 PM. |
|
|
|
|
|
|
#6 | |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
Quote:
|
|
|
|
|
|
|
#7 | |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
Quote:
|
|
|
|
|
|
|
#8 | |
|
~ Ryan ~
|
Quote:
Sound advice... thanks. I've got another PC coming in my sea shipment, so when it gets here, I can set one of my linux boxes up as a test server. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| External Dvd Burner Not Working | PreDeadMan | Computer Hardware | 1 | 09-17-2005 03:48 PM |
| Antivirus broken, HJT logfile | EDB | Networking & Online Security | 6 | 09-12-2005 12:21 PM |
| Centering include file asp | racerxfactor | Web Design / Development | 2 | 08-22-2005 10:12 PM |
| Backing up Outlook Express | keifir | Windows Legacy Support (XP and earlier) | 9 | 08-17-2001 05:06 PM |
| Dos in Win98SE | Charles | Windows Legacy Support (XP and earlier) | 36 | 07-30-2001 11:59 PM |