vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   invoking a php in html. (https://vborg.vbsupport.ru/showthread.php?t=61709)

lorden 02-18-2004 08:39 PM

invoking a php in html.
 
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:
Code:

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
PHP Code:

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
Code:

include("/forums/test.php");
if your using vb2
open phpinclude
add in there:
Code:

include("/forums/test.php");


All times are GMT. The time now is 06:07 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02306 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete