Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1067 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

phpincluding and all that good stuff

Thread title: phpincluding and all that good stuff
Closed Thread    
    Thread tools Search this thread Display Modes  
02-15-2005, 07:42 PM
#1
sliceandcode is offline sliceandcode
Status: Request a custom title
Join date: Aug 2004
Location: California
Expertise:
Software:
 
Posts: 1,004
iTrader: 0 / 0%
 

sliceandcode is on a distinguished road

  Old  phpincluding and all that good stuff

So I'm using CuteNews for one of my sites and I want the news to display on the site without having to use an iframe so I'd have to do a phpinclude thingie..

Anyway, this is what I would have to put:

Code:
<?PHP
 $number = "5";
 $category = "2";
 include("path/to/show_news.php");
?>
The problem is that it's not in the same directory as my site so it won't show up. I'm a total newb at this and would appreciate any solutions that you guys come up for me.

02-16-2005, 06:57 PM
#2
phpmonkey is offline phpmonkey
Status: I'm new around here
Join date: Feb 2005
Location: Seattle
Expertise:
Software:
 
Posts: 13
iTrader: 0 / 0%
 

phpmonkey is on a distinguished road

Send a message via AIM to phpmonkey Send a message via MSN to phpmonkey Send a message via Yahoo to phpmonkey

  Old

Use fully-qualified names i.e.

include('/home/username/htdocs/whatever/folder/here/stuff.php');

It's faster,and you can move around the file and have no problems.

02-19-2005, 04:12 PM
#3
DateinaDash is offline DateinaDash
Status: The BidMaster
Join date: Nov 2004
Location: England
Expertise:
Software:
 
Posts: 10,821
iTrader: 0 / 0%
 

DateinaDash is on a distinguished road

  Old

Good advice

Closed Thread    


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

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed