PHP include in HTML, help?  | |
October 5th, 2002, 09:27 PM
|
#1 (permalink)
| | ph34r t3h g04t
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 19,558
| PHP include in HTML, help?
Okay, I've tried several different variants of includes to try to get this PHP tagboard I downloaded to work inside of a table. The tagboard works perfectly if you link directly to it, so I presume that there is no problem with the tagboard's code.
So far I've tried...
<!-- #include virtual="./tagboard/index.php" -->
<? include('./tagboard/index.php'); ?>
<?PHP include "./tagboard/index.php"; ?>
Nothin' works. Anyone got any ideas?
Server does run PHP fine, as the tagboard works when hit directly (not to mention we host sites that are done pure PHP).
-Whir |
| |
October 6th, 2002, 04:26 PM
|
#2 (permalink)
| | Senior Member
Join Date: Oct 2001 Location: Alberta, Canada
Posts: 563
|
hhmm, at the very least, here's a bump for you!
but, from what I see, technically, <? include('./tagboard/index.php'); ?> should work if I remember correctly(as long as it's in a *.php page!), you may need double quotes instead of single, but I don't think that's it...
but I'm wondering about your pathing, "./tagboard/index.php". When you specify the first part " ./" doesn't this (particularly the " .") path from the root directory of the webserver?? rather than from the virtual directory?(I could be wrong)
Therefor, if that's correct, if this was in "<webroot>/ my_web_app/somepage.php", it would look for "index.php" in "<webroot>/tagboard/", when possibly you want it to be "<webroot>/ my_web_app/tagboard/index.php"
or perhaps you wanted to path from the <webroot>(which is the reason for "./"), and not from the virtual directory...
did that make any sense??
anyways, g'luck!!  |
| |
October 6th, 2002, 04:58 PM
|
#3 (permalink)
| | Ultimate Member
Join Date: May 2000 Location: Miami, FL.
Posts: 2,841
|
are you using the extenstion *.phtml??? |
| |
October 7th, 2002, 01:51 AM
|
#4 (permalink)
| | Banned
Join Date: Sep 2002
Posts: 194
|
open up your php.ini and look for the include_path. make sure the include path is blank so you can use relative links so <?php inclue("joe.inc"); ?> includes ./joe.inc and not C:/php/includes/joe.inc or /usr/php/includes/joe.inc or whatever.
btw the proper form is <?php include("tagboard/index.php") ;?
there is no need for the ./ because it already tries to set it as relative directory. |
| |
October 7th, 2002, 01:55 AM
|
#5 (permalink)
| | ph34r t3h g04t
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 19,558
|
Hm. I did try that path w/out the ./ and w/out the ./tagboard/ when I had it in there. Finally, I gave up and just added the HTML from the tagboard .php and lo and behold it worked. Found out that our admin disable SSI for the server, so no matter what I tried, it wouldn't have worked.
Nice spam on my board BTW, ^hyd^.
Thanks, y'all. |
| |
October 7th, 2002, 02:25 AM
|
#6 (permalink)
| | Banned
Join Date: Sep 2002
Posts: 194
|
i didn't even know you COULD disable that.... |
| |
October 7th, 2002, 02:30 AM
|
#7 (permalink)
| | ph34r t3h g04t
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 19,558
|
According to the NetAdmin you can. He runs Apache something on RH7.3, so I'm guessing it might be something you can do with Apache? He said he shut off ALL SSI, not just PHP. I'm not a server guy, so I woudln't know. I get paid the little bucks to be a developer. :P Wait, I'm jobless. I get paid no bucks to be a developer. Ah well.
I'm assuming that were SSI active, I could use this line: <? include('./tagboard/index.php'); ?>
and it would work out okay. That's what the instructions I had said anyway... |
| |
October 7th, 2002, 06:07 PM
|
#8 (permalink)
| | Senior Member
Join Date: Oct 2001 Location: Alberta, Canada
Posts: 563
|
hehehe, didn't realise that it saved all of that!! Oh well, it was empty, had to do something about that!!
glad to see you got it going!!  with or without the include();
cheers!  |
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |