Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Won't echo function from included file
Old 07-24-2009, 07:08 AM Won't echo function from included file
KieranC's Avatar
Average Talker

Posts: 20
Trades: 0
I have one main file here which is (I'm fairly sure) where the problem is.

index.php is as follows:
PHP Code:
<?php

// Access to this page only
define("NZ_GOLF"1);

// Includes
require_once(dirname(__FILE__) . "/tpl/inc/config.php");

// The array of main actions
$actionArray = array(
    
'manageclubs' => array('manageClubs.php''manageClubs'),
    
'articles' => array('articles.php''articles'),
    
'settings' => array('settings.php''settings'),
    
'managetournaments' => array('manageTournaments.php''manageTournaments')
);

// Get the function and file to include - if it's not there, do the board index.
if(!isset($_REQUEST['act']) || !isset($actionArray[$_REQUEST['act']]))
{
    require_once(
dirname(__FILE__) . '/tpl/home.php');
    return 
home();
}

// Otherwise, it was set - so let's go to that action.
include(dirname(__FILE__) . '/tpl/' $actionArray[$_REQUEST['act']][0]);
return 
$actionArray[$_REQUEST['act']][1];

?>
For some reason, when going to "index.php?act=manageclubs", the function (manageClubs) will not return unless a return statement is added to the manageClubs.php file itself.

As you might notice, some of the code is taken from SMF. SMF works! And I can't figure out why this doesn't...

Thanks so much for any help given. This is bugging me like hell.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Last edited by KieranC; 07-24-2009 at 07:16 AM..
KieranC is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-24-2009, 09:49 AM Re: Won't echo function from included file
KieranC's Avatar
Average Talker

Posts: 20
Trades: 0
Just got this fixed. Had to use a completely different method, but it's working anyway.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
KieranC is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Won't echo function from included file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15937 seconds with 12 queries