Page 1 of 1

Need help on include file please.

Posted: Fri Dec 23, 2005 1:29 am
by w4rzadmnjp
Sami | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


I can not get the file to show.  Please help....
<?php include('www.undergroundtournaments.com/utts/order.php') ?> is the string im working on and order.php is the file i want to show in the file below.  Globals are on.

Code: Select all

<?
$indexloaded=1;

include("config/config.php");
include("$dir[func]/global.php");
include("$dir[func]/loginforms.php");

switch($action){

case "utts":
utts();
break;

default:
utts();
break;
}


function utts(){
global $url, $file, $dir, $out, $site, $admn;


$tablehead=table_head("show","400","","left");
$tablefoot=table_foot("show");


$out[body]=$out[body]."
<table width='450' border='0' cellspacing='0' cellpadding='1'>
<tr>
<td width='100%' align=center valign=top>

<table cellspacing=0 cellpadding=0 border=0 width='90%'>
<tr><td>
<center>
$tablehead
&nbsp; &nbsp;<strong><font color='#000000'>"Teamspeak is a quality, scalable application which enables people to speak with one another over the Internet. The Teamspeak server acts as a host to multiple client connections, capable of handling literally thousands of simultaneous users. This results in an Internet based teleconferencing solution that works in a variety of applications such as team mates speaking with one another while playing their favorite online game, small businesses cutting costs on long distance charges, or for personal communication with friends and family.&quot <a href='http://www.goteamspeak.com' target='new'>http://www.goteamspeak.com</a></font></strong><br>
<hr color='#000000' size='1' align='center'>
<div align='center'><img src='https://www.paypal.com/en_US/i/bnr/horizontal_solution_PP.gif' alt='Solution Graphics' />
<a href='https://www.paypal.com/us/verified/pal=ugtpaypal%40undergroundtournaments.com' target='_blank'><img src='http://www.paypal.com/en_US/i/icon/verification_seal.gif' alt='Verified' border='0' /></a>
</div>
<u><center><strong>Account Features</strong></center></u></a>
<br>
<table width='60%' align='center' cellspacing='0' cellpadding='0'><tr><td align='left'>
<ul>
<li>No setup fee</li>
<li>99% Uptime Guarantee</li>
<li>All codecs allowed, <strong>NO</strong> restrictions!</li>
<li>Get your server in 5 minutes!</li>
<li>Online Control Panel</li>
<li>Easily configure your server with our online Control Panel</li>
<li>You choose: Private or Public</li>
<li>No bandwidth limit! Talk all you want!</li>
</ul>
</td></tr></table>
<br>
<b>Our Public Demo TeamSpeak Server is available at <i><a href='teamspeak://207.44.140.85:9800'>207.44.140.85:9800</a></i>
<br>
<center>

<?php include('www.undergroundtournaments.com/utts/order.php') ?>


</p>
$tablefoot
</form>
</table></table>";


include("$dir[curtheme]");
}
?>

Sami | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Fri Dec 23, 2005 3:49 am
by twigletmac
Which version of PHP are you using and on which platform? From the manual (http://uk.php.net/manual/en/function.include.php):
Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote files via this function, even if allow_url_fopen is enabled.
Can you include any remote files?

Mac

Here is my php info

Posted: Sat Dec 24, 2005 12:37 am
by w4rzadmnjp

Posted: Sat Dec 24, 2005 4:04 am
by m3mn0n
Step 1: Create a new php file on the development server
Step 2: Add the following code into this file:

Code: Select all

<?php
echo '<pre>';
echo 'PHP Version: '.phpversion()."\n";
echo 'Display Errors: '.(ini_get('display_errors') == '1' ? 'On' : 'Off')."\n";
echo 'Error Level: '.(ini_get('error_reporting') == '2047' ? 'E_ALL' : 'Not E_ALL')."\n";
echo 'Register Globals: '.(ini_get('register_globals') == '' ? 'Off' : 'On')."\n";
echo '</pre>';

/*
PHP Version: 4.3.4RC2-dev
Display Errors: On
Error Level: E_ALL
Register Globals: Off
*/
?>
Step 3: Post whatever that code outputs into a reply here so we can learn more about your development environment. An example of the output is commented in the above snippet.

Posted: Sat Dec 24, 2005 3:22 pm
by aphex
I help w4rzadmnjp but he is out of town right now so I will be here to answer questions :D

Here is the info you wanted:

Code: Select all

PHP Version: 4.3.11
Display Errors: On
Error Level: Not E_ALL
Register Globals: On

Posted: Sun Dec 25, 2005 7:01 am
by s.dot
I've never worked with including remote files before, but try include("http://... with the http:// in there.
If it is a local file, don't use the url

Posted: Sun Dec 25, 2005 6:20 pm
by aphex
i tried that i believe.

here is something else i have also tried:
this would be named file.php in directory "blah"

Code: Select all

<?
$blah."
//all relavant code here
";
?>
and to call it in another file:

Code: Select all

include("blah/file.php");

function myfunc()
{
     $blah
}
but also just displays it at the top of the page where we don't want it. don't know why it's doing that..

also tried this:

Code: Select all

function myfunc()
{
     <?
           include('blah/file.php');
           echo($blah);
     ?>
}
but this also displays at top of the page. getting very annoying now :o

Posted: Sun Dec 25, 2005 10:04 pm
by Jenk
view the source of your html - are things in the order in which you expect them to be?

Posted: Wed Dec 28, 2005 10:33 pm
by aphex
it shows at the top also.