user1181589
user1181589

Reputation: 153

Require once from outer directory

Im trying to design a web site. It's currently set up on wamp, and i use a script called "ComboboxForm.php" located in the following directory:

wamp/php/proyecto/scripts

In ComboboxForm.php i need to require a script that is located in

"wamp/php/proyecto".

How can i require it from an inner directory? i tried

require_once("../php/proyecto/conectar.php");

but it does not work

Upvotes: 0

Views: 43

Answers (1)

GolezTrol
GolezTrol

Reputation: 116180

Just require_once("../conectar.php"); should do. After all, it looks like the file to include is exactly one directory up relative to the script.

Upvotes: 2

Related Questions