• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

PHP Include - Help

^^ So what are the differences between the two commands? Why is require_once any better?
 
Yeah, I tried that and it didn't work.

And anyways, If it's the same script style, It shouldn't be any different? Should it?

I will just install a guestbook on my site over the shoutbox.
I have too much and nothing seemed to work so that's my only solution. :]
 
so basically... if you have something included in one php file.. and your including the same thing in the parent file it'll be used twice. This drags down the performance of your scripts.

E.g.:
file1.php:
PHP:
<?php
include("config.php");
// some stuff below
?>

config.php
PHP:
<?
// stuff in here
?>

file3.php
PHP:
include("file1.php");
include("config.php");

here you see that config.php is included in file3.php & file1.php.
If you use require_once instead than it'll only be used once :)
 
only joined to let you know that its saying it cant open file because the other php and the db file used are called as if they are in the same directory as the floodbox.php.

youre callin the floodbox.php correctly if you get cant open file. its just that now when the script is running is looking for $file=config.php when it should be looking for $file=./floodboxdirectory/config.php

the easy solution is copy everything in your floodbox directory to the directory of the page youre displaying it on. you dont need the index.html file from the floodbox folder though. then use

<?php require_once('floodbox.php'); ?>

to call the floodbox.

hope this helps you out.
 
Oh Wow...
That actually worked
I would've never thought of that very simple solution [lol]
Thanks dude! :-D I had already given up on this
But you made it possible :] ++
 
Back
Top