Getting getcwd() to work with my localhost (through Wordpres

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ldexterldesign
Forum Newbie
Posts: 15
Joined: Fri Apr 17, 2009 6:14 am
Location: Bristol, UK

Getting getcwd() to work with my localhost (through Wordpres

Post by ldexterldesign »

Hi guys,

Having a bit of trouble here with this function. Has anyone got it to pull a correct path through a localhost (I'm using XAMPP)?

I've had the script working fine on my webserver, although whenever I use the script locally instead of using

Code: Select all

http://localhost[..]
as the prefix it uses my local C:drive:

Code: Select all

C:\xampp\htdocs\wordpress/wp-content/themes/ldexterldesign
.

Any thoughts?

Thanks,
L

PS. Not sure if this is accepted on this forum - it's cross posting, so apologies if so - but I put this up at the Wordpress forum: http://wordpress.org/support/topic/262937?replies=2 It's the scripts I'm referring to in this post.
User avatar
jazz090
Forum Contributor
Posts: 176
Joined: Sun Apr 12, 2009 3:29 pm
Location: England

Re: Getting getcwd() to work with my localhost (through Wordpres

Post by jazz090 »

you got backslashes and forwardslashes in ur path, just use: "/xampp/hdocs/wordpress/wp-content/themes/etc/ and will work, i got xampp on same directory and that works fine.
ldexterldesign
Forum Newbie
Posts: 15
Joined: Fri Apr 17, 2009 6:14 am
Location: Bristol, UK

Re: Getting getcwd() to work with my localhost (through Wordpres

Post by ldexterldesign »

jazz090 wrote:you got backslashes and forwardslashes in ur path, just use: "/xampp/hdocs/wordpress/wp-content/themes/etc/ and will work, i got xampp on same directory and that works fine.
Thanks for the reply. The backslashes are generated by PHP, not me :cry:

I will persevere.

L
Post Reply