Need help on include file please.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
w4rzadmnjp
Forum Newbie
Posts: 2
Joined: Thu Dec 22, 2005 11:40 pm

Need help on include file please.

Post 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]
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
w4rzadmnjp
Forum Newbie
Posts: 2
Joined: Thu Dec 22, 2005 11:40 pm

Here is my php info

Post by w4rzadmnjp »

User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post 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.
aphex
Forum Newbie
Posts: 3
Joined: Sat Dec 24, 2005 3:20 pm

Post 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
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
aphex
Forum Newbie
Posts: 3
Joined: Sat Dec 24, 2005 3:20 pm

Post 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
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

view the source of your html - are things in the order in which you expect them to be?
aphex
Forum Newbie
Posts: 3
Joined: Sat Dec 24, 2005 3:20 pm

Post by aphex »

it shows at the top also.
Post Reply