PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 28th, 2004, 08:07 AM
lilleydn lilleydn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 11 lilleydn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy PHP include relative links

Hi
Most likly being incredibly dumb here,

I have 3 seperate files here
connection.php - connection to mysql
functions.php - odd functions
find_records.php - finds all public records
find_all_records.php - finds all nonpublic & public records

in my www root there is
connection.php - connection to mysql
functions.php - odd functions
find_records.php - finds all public records

in the nonpublic dir there is connection.php
find_all_records.php - finds all nonpublic & public records

The problem is that both find_all_records.php &find_records.php include functions.php and within functions it includes connections.php

so using include('connection.php'); would make the find_records work but the find_all_records would fail

so using include('../connection.php'); would make the find_all_records work but the find_records would fail

Any ideas?
Cheers
Dave

Reply With Quote
  #2  
Old March 28th, 2004, 03:58 PM
tobycloud tobycloud is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Near Albany NY
Posts: 27 tobycloud User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to tobycloud Send a message via AIM to tobycloud
You know you can include more then one file right? So why not include both?

Reply With Quote
  #3  
Old March 29th, 2004, 11:34 AM
lilleydn lilleydn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 11 lilleydn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the reply

Hi

Many thanks for the reply,

The idea suggest is a good one but it is still bit of a hack (I need this code to be quite tidy) but many thanks any how probably better than current solution which is to create two versions of connection.php
root/connection.php
and
root/somedir/connection.php

with root/somedir/connection.php referencing version of
root/connection.php

Many thanks any how

DAave

Reply With Quote
  #4  
Old March 29th, 2004, 03:56 PM
tobycloud tobycloud is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Near Albany NY
Posts: 27 tobycloud User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to tobycloud Send a message via AIM to tobycloud
What seems like another obvious solution would be to compund the files. Is this possible?

Reply With Quote
  #5  
Old March 30th, 2004, 05:37 PM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
im not sure what u'r getting ta :S can u explain different ?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP include relative links


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT