View Full Version : invoking a php in html.
lorden
02-18-2004, 08:39 PM
I've got a silly question.
I got a php banner rotation file called test.php in my forums folder.
Now i'm trying to invoke it in my homepage of my site.
I am currently running vbindex so i open it's index template and add ;
<!--#include file="forums/test.php" -->
it doesn't seem to work.
anyone know the code i need to input to invoke my php banner on the top fo my page? thanks
Andreas
02-18-2004, 09:06 PM
Do you have SSI (Server Side Includes) enabled?
For Apache smth. like this in httpd.conf:
AddType text/html .shtml
AddHandler server-parsed .shtml
AN-net
02-18-2004, 09:37 PM
well on the page you want to display it add
include("test.php");
to the file at then you can call the variables from that php file in the templates for the .php files you added the include to
Andreas
02-18-2004, 10:28 PM
@AN-net
I don't think this will wok in a HTML-file, which is what lorden want's to have.
lorden
02-22-2004, 03:43 PM
Hey guys thanks for the reply, i wasn't subbed on this thread and i had no idea there was reply.
@AN-net: I have tried that and it doesn't work.
@KirbyDE, SSI is enabled BUT my webhost does not allow me to access HTTP.conf, they tell me though i can created a .htaccess file to do those commands, unfortuantely i keep getting internal server error when i try to create one soi gave up that concept.
I would still like a answer to this question if possible with a little twist, I actually resolved this problem by invoking the banners as java and jsut adding them in the "index" template and it works just fine.
I have never worked with php in my life before and don't quite understand the basics to it. Something that noramlly would take 5 minutes to make takes me a few hours because I have to make sense of the code and try to find the source of it which is actually pretty fun.
But i'm stuck now since i really don't know the bases of PHP, i have no idea the difference between vbulletin's template and PHPadmin's template, and how all this molds into a php file.
Working with hacks and customising them is quite fun and simple for me but now I am at the point where I have a quicklink bar and i would like to open a whole new page to do that.
For example on my homepage if someone clicks on "reviews" I want them to open a page in the middle of my vbindex (that way they still have acces to the rest of there tools) but i don't know where to start.
Anyone can direct me to a site where i can read the basics of php and the "complete idiot's guide" (no joke i really like those books they really break them down :P)
Again thanks for all your help and support
AN-net
02-22-2004, 04:09 PM
well you could put it in between <?PHP and ?>. it should work then
lorden
02-22-2004, 04:25 PM
yeah i'll be able to do that but ih ave no idea what to write in between there ;) i'm looking for a dummies guide to PHP to give me the basics on how to create them.
vBulletin is great, a monkey can do it because it's all setup for you, even customizing is a breeze but i don't want to be limited to it's hacks I want to add 2 more pages and i don't know how.
AN-net
02-22-2004, 06:19 PM
hmm so this image rotation script basically randomly chooses and it doesnt use a variable like $banner to display the image, if so then you can put in the template <img src="test.php">.
if the file uses a variable such $banner to display the image then my idea is include the file globally.
if your using vb3
open phpinclude_start
and insert this code in there
include("/forums/test.php");
if your using vb2
open phpinclude
add in there:
include("/forums/test.php");
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.