corsasport.co.uk
 

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

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

Dom

posted on 29th Nov 06 at 21:21

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


Tim

posted on 29th Nov 06 at 19:37

Don't need substr, just use:

code:
dirname($_SERVER[SCRIPT_FILENAME])


...but better to use:

code:
getcwd()


[Edited on 29-11-2006 by Tim]


Steve

posted on 29th Nov 06 at 19:13

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


Dom

posted on 29th Nov 06 at 19:11

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,
:thumbs:

[Edited on 30-11-2006 by Ian]