• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

How to use/access a directory above the web root?

Hi experts,

I'm trying to create a script to ease the connection to MySQL for my users (without having to download an ODBC driver). And I've created a php-script that creates XML files out of the MySQL queries.

It works fine at the moment, but I'm concerned about the security and wonder if I could save the files to a directory outside the web root and access it from there instead. I've been googling the matter, but not found a solution.

I assume in PHP I would just save the XMLs to "/home/safedir/" instead of "/home/www/" but how would I connect to it again from an offline application (Excel VBA)? Is it even possible?

Regards,
eX.
0
Gaute Rønningen
Asked:
Gaute Rønningen
  • 2
  • 2
1 Solution
 
shobinsunCommented:
Hi,

you can use include() method.

for example: include('/root/filename1');  (in /var/www/html/filname.php)
0
 
Gaute RønningenAuthor Commented:
Yes, but if I should use MSXML2 in Excel then I would need an url to insert into the DOMDocument.
What would that url be if I store it on a safedir? Or do I have to create another script to get it from the safedir?
0
 
shobinsunCommented:
Hi,

Please clarify tour need?
0
 
-null-Commented:
Hi,

You would put your file into your safedir, then use another script to retrieve the contents and pass them back, using something like file_get_contents.  This way, the file is still available, but it isn't sat on a public url.  You can then use sessions or similar to control access to the proxying script.

-null-
0
 
Gaute RønningenAuthor Commented:
Was as I suspected, just needed to know if there was any other way of doing it. Thanks. :-)
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now