Maria
Maria

Reputation: 1

How do I browse a php file in a different directory?

I am trying to search in google for php code that will let me load or browse a file work2.php.

Note that my directory is /home/meria/public_html/work/.

example: /home/meria/public_html/work/code.php

The target file is: /var/work2.php

Upvotes: 0

Views: 159

Answers (2)

Naftali
Naftali

Reputation: 146300

If: /home/meria/public_html/work/code.php
going to: /var/work2.php

include "../../../../var/work2.php"; // I might be a little off

Upvotes: 1

kayahr
kayahr

Reputation: 22020

Maybe you just want to include the file?

<?php
include "/var/work2.php";

Upvotes: 2

Related Questions