How to load a file 3 directorys back from me..

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
tommytx123
New php-forum User
New php-forum User
Posts: 20
Joined: Sat Sep 19, 2015 4:57 pm

Fri Oct 09, 2015 6:01 pm

The file wp-load.php is in the home/ directory (public_html)

if my test file is in /public_html/wp-content/plugins/idx-plus/test.php

what do i need in the test.php to activate the wp-load.php located in the home directory (public_html)

test.php file
--------------
include(..../wp-load.php);

bottom line how may dots do I need to load the wp-load.php file..

I tried 1 thru 5 and each one failed..

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 974
Joined: Mon Oct 01, 2012 12:32 pm

Fri Oct 09, 2015 7:47 pm

you have to do 2 dots per layer up, ../../../load.php in this case, or even more easily, "/load.php" as "/" is interpreted as your webroot

tommytx123
New php-forum User
New php-forum User
Posts: 20
Joined: Sat Sep 19, 2015 4:57 pm

Sun Oct 25, 2015 3:47 pm

Thank you that worked great... sorry for the delay.. I saw it right away but forgot to respond to it..

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 974
Joined: Mon Oct 01, 2012 12:32 pm

Tue Oct 27, 2015 7:30 am

No worries, I'm glad I could help

Post Reply