Current location: Hot Scripts Forums » Programming Languages » PHP » Including a File but cant use the include tag


Including a File but cant use the include tag

Reply
  #1 (permalink)  
Old 04-14-05, 01:02 PM
Dainbramaged05 Dainbramaged05 is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Including a File but cant use the include tag

I need to include the file /forum/newsout.php into this script, but i can't use the include that due to the way it is scripted. when you use the include tag where I want the file to show up, it just shows the include tag. how do I do it, if anyone can help... it needs to be added down in the headlines section on the table, i have it commented where


PHP Code:

<?


if(!$indexloaded){
header("Location: ./index.php");
}

function 
main_page(){
global 
$dir$url$file$out$misc;

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

//GET LINKS

$topfiles=mysql_query("SELECT id,name,imageurl FROM links ORDER by id");

while(list(
$linkid,$linkname,$linkimage)=mysql_fetch_row($topfiles)){

if(!
$linkimage){

$linklist=$linklist."$out[bulletleft] <a href='$url[base]/$file[links]?linkid=$linkid' target='top'>$linkname</a><br>";

}else{

$linklistb=$linklistb."<br><center><a href='$url[base]/$file[links]?linkid=$linkid' target='top'><img src='$linkimage' border='0' alt='$linkname'></a></center>";

}

$linkimage="";

}

$linklist="$linklist $linklistb";




$out[body].="

<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'>



<tr>

<td width='2%' valign='top' align='left'>&nbsp;</td>

<td width='71%' valign='top' align='left'>





<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'>

<tr>

<td width='100%' valign='top' align='center'>"
;


$out[body].="

<br />

$tablehead

&nbsp; &nbsp;<strong><font class='catfont'>Headlines</font></strong><br>

<hr class='catfont' size='1'>



//////////////////////////// It needs to be added here ///////////////////////////////


$tablefoot";


$out[body].="

</td>

</tr>

</table>



</td>

<td width='2%' valign='top'>&nbsp;</td>

<td width='23%' valign='top'>



<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'>

<tr>

<td width='100%' valign='top' align='center'>



<br>



$tablehead

&nbsp; &nbsp;<strong><font class='catfont'>Stats</font></strong><br>

<hr class='catfont' size='1'>

$stats

$tablefoot



<br>

$tablehead

&nbsp; &nbsp;<strong><font class='catfont'>Links</font></strong><br>

<hr class='catfont' size='1'>

$linklist

$tablefoot


<br>

$tablehead

&nbsp; &nbsp;<strong><font class='catfont'>MLO Top Money Winners</font></strong><br>

<hr class='catfont' size='1'>

<table width='100%' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td>
1. &nbsp; $300 &nbsp; Name Withheld<br />
2. &nbsp; $250 &nbsp; Taylor Seale<br />
3. &nbsp; $250 &nbsp; Jeff Zuendt<br />
4. &nbsp; $200 &nbsp; John Nguyen<br />
5. &nbsp; $125 &nbsp; Jeremy Grahm<br />
6. &nbsp; $125 &nbsp; Mike Johnson<br />
7. &nbsp; $125 &nbsp; Joey Goehner<br>
8. &nbsp; $120 &nbsp; Chris Blackburn<br />
9. &nbsp; $100 &nbsp; Pete Duke<br />
10. $100 &nbsp; Dave Perry<br /><br />
</td>
</tr>
</table>


$tablefoot


</td>

</tr>

</table>


</td>

<td width='18%' valign='top' align='right'>&nbsp;</td>

</tr>

</table>


"
;


include(
"$dir[curtheme]");

}

?>

Last edited by Dainbramaged05; 04-14-05 at 01:06 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 04-16-05, 07:03 AM
dennispopel dennispopel is offline
Coding Addict
 
Join Date: Mar 2005
Posts: 263
Thanks: 0
Thanked 0 Times in 0 Posts
If it's a static include file, just load its content with file_get_contents() function. Also, please consider studing little more PHP as the code shows you are not very good at it yet.
__________________
onPHP5.com - PHP5: Articles, News, Tutorials, Interviews, Software and more
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-10-05, 01:20 AM
Dainbramaged05 Dainbramaged05 is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
I didn't code it, otherwise I wouldn't be asking the question.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-10-05, 06:16 AM
Richard's Avatar
Richard Richard is offline
Wannabe Coder
 
Join Date: Sep 2005
Location: Oxford, UK
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
Wasn't this posted on the 14th April this year?
---
Our of curiousity, have you managed to resolve the problem?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 10-10-05, 08:00 AM
blackcode blackcode is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
lol, took 6 months to look at the anwser
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Including file in javascript twin JavaScript 0 02-04-05 07:52 AM
Server open file altafingar ASP.NET 1 10-20-04 01:12 AM
Getting the created file (fopen/fwrite) Programme PHP 5 02-14-04 04:09 PM
Please I Need help before all my hair is gone! LisatheNovice Perl 6 11-22-03 04:05 PM
Upload file type and size limiter! Arctic ASP 1 08-02-03 08:06 PM


All times are GMT -5. The time now is 12:40 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.