Forum Topic: PHP - multiple Require()

(253 views • 7 replies)

This topic is 1 page long.

<< < > >>
None

A17roolz

Reply To Post Reply & Quote

Posted at: 7/16/06 04:29 PM

A17roolz NEUTRAL LEVEL 18

Sign-Up: 11/13/02

Posts: 997

I'm having troubles with a php code. I'm trying to use a news fetch and a login on non-forum pages mod for my vBulletin forum, but they both use the "require" code. For the news fetch, I have to code:

<?php
chdir('/home/******/public_html/bbs');
require_once('/home/******/public_html/bbs
/vBExternal.php');
?>

And for the login, I need to code:

<?php
chdir('/home/******/public_html/bbs');
require_once('/home/******/public_html/bbs
/global.php');
?>

Now, stand alone, these are fine and work perfectly. However, if I do something like this:

<?php
chdir('/home/******/public_html/bbs');
require_once('/home/******/public_html/bbs
/vBExternal.php');
require_once('/home/******/public_html/bbs
/global.php');
?>

I get a blank page. I've tried everything, putting the codes seperate, making one require_once() and the other require(), switching the two around... everything, but nothing works. Help!


None

elbekko

Reply To Post Reply & Quote

Posted at: 7/16/06 04:52 PM

elbekko EVIL LEVEL 16

Sign-Up: 07/23/04

Posts: 6,450

Why the chdir?

"My software never has bugs. It just develops random features. " - Unknown

[ PHP: Main | Omigod, a blog ]

BBS Signature

None

A17roolz

Reply To Post Reply & Quote

Posted at: 7/16/06 04:57 PM

A17roolz NEUTRAL LEVEL 18

Sign-Up: 11/13/02

Posts: 997

At 7/16/06 04:52 PM, elbekko wrote: Why the chdir?

It's required by the mods.


None

WoogieNoogie

Reply To Post Reply & Quote

Posted at: 7/16/06 05:26 PM

WoogieNoogie LIGHT LEVEL 14

Sign-Up: 06/26/05

Posts: 3,195

Try this?

<?php
chdir('/home/******/public_html/bbs');
require_once('vBExternal.php');
require_once('global.php');
?>


None

A17roolz

Reply To Post Reply & Quote

Posted at: 7/16/06 05:43 PM

A17roolz NEUTRAL LEVEL 18

Sign-Up: 11/13/02

Posts: 997

At 7/16/06 05:26 PM, WoogieNoogie wrote: Try this?

<?php
chdir('/home/******/public_html/bbs');
require_once('vBExternal.php');
require_once('global.php');
?>

Nope, didn't work :'(


None

WoogieNoogie

Reply To Post Reply & Quote

Posted at: 7/16/06 05:54 PM

WoogieNoogie LIGHT LEVEL 14

Sign-Up: 06/26/05

Posts: 3,195

At 7/16/06 05:43 PM, A17roolz wrote: Nope, didn't work :'(

I'm sorry...maybe, have you tried removing the _once from both of the require statements?


None

elbekko

Reply To Post Reply & Quote

Posted at: 7/16/06 06:00 PM

elbekko EVIL LEVEL 16

Sign-Up: 07/23/04

Posts: 6,450

<?php
chdir('/home/******/public_html/bbs');
require_once('/home/******/public_html/bbs
/vBExternal.php');
chdir('/home/******/public_html/bbs');
require_once('/home/******/public_html/bbs
/global.php');
?>

Maybe that works... you never know :P

"My software never has bugs. It just develops random features. " - Unknown

[ PHP: Main | Omigod, a blog ]

BBS Signature

None

A17roolz

Reply To Post Reply & Quote

Posted at: 7/16/06 06:02 PM

A17roolz NEUTRAL LEVEL 18

Sign-Up: 11/13/02

Posts: 997

At 7/16/06 06:00 PM, elbekko wrote: <?php
chdir('/home/******/public_html/bbs');
require_once('/home/******/public_html/bbs
/vBExternal.php');
chdir('/home/******/public_html/bbs');
require_once('/home/******/public_html/bbs
/global.php');
?>

Maybe that works... you never know :P

Already tried that, doesn't work. Thanks anyhow.


All times are Eastern Standard Time (GMT -5) | Current Time: 08:38 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!