corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP dudes


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author PHP dudes
Dom
Member

Registered: 13th Sep 03
User status: Offline
29th Nov 06 at 19:11   View User's Profile U2U Member Reply With Quote

Right, anyone know how to return the directory of which the script relies in?

ie: the script is in "C:/wamp/www/guestbook/index.php", want to retrieve "C:/wamp/www/guestbook/"....etc

can get the path including script name with $_SERVER['SCRIPT_FILENAME'], but was wondering if there was a simple way of getting just the path....so far, it seems i have to fart about with substr (which so far isn't going too well)

Cheers all,


[Edited on 30-11-2006 by Ian]
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
29th Nov 06 at 19:13   View Garage View User's Profile U2U Member Reply With Quote

if im correct in thinking what your trying to do, just use a mod rewrite in a htaccess file?
Tim
Site Administrator

Avatar

Registered: 21st Apr 00
User status: Offline
29th Nov 06 at 19:37   View Garage View User's Profile U2U Member Reply With Quote

Don't need substr, just use:

code:
dirname($_SERVER[SCRIPT_FILENAME])


...but better to use:

code:
getcwd()


[Edited on 29-11-2006 by Tim]
Dom
Member

Registered: 13th Sep 03
User status: Offline
29th Nov 06 at 21:21   View User's Profile U2U Member Reply With Quote

htaccess can't be done as its going on a CD etc But Tim, your a leg-end, much appriciated as i was looking around for ages

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
**Sunday 4th May Reebok Stadium @ 13:00 Be There** andy hirst Meets and Events 72 3033
7th May 03 at 16:03
by Kerry
 
yo dudes im back (lets do something on sunday night) dig dave2811 South Wales 8 768
27th Nov 03 at 23:13
by XTC113
 
Yo pumpkins check the maxlive list SteveW South Central 3 797
19th Mar 04 at 19:13
by Red_Sxi
 
PVS Prepping... PaulW North West and North Wales 21 757
20th May 05 at 07:18
by PaulW
 
What happenned to the dutch 155bhp bucket? 5chaap2k Help Zone, Modification and ICE Advice 55 3335
22nd Nov 05 at 13:24
by 5chaap2k
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP dudes 29 database queries in 0.0105629 seconds