The way access with PHP a sensitive passwords files, eg db.php, outside web reach is the same in a VPS LAMP like XAMPP?
How do this in XAMPP?
lse123 wrote:can you provide a file structure with full pathname? full pathname from where?
C:\xampp\htdocs\siteY\index.php how access from here db.php?
C:\xampp\db.php
<?php
include "C:/xampp/db.php";
...
?>
Nobbie wrote:lse123 wrote:can you provide a file structure with full pathname? full pathname from where?
C:\xampp\htdocs\siteY\index.php how access from here db.php?
C:\xampp\db.php
Example:
In C:/xampp/htdocs/siteY/index.php you can include db.php:
- Code: Select all
<?php
include "C:/xampp/db.php";
...
?>
<?php
include "..\..\db.php";
...
?>
cmb69 wrote:ACK. However, you could even use a relative file path:
- Code: Select all
<?php
include "..\..\db.php";
...
?>
include __DIR__ . '/../../db.php';
lse123 wrote:what about:
$dir = dirname(__FILE__);
???
Users browsing this forum: No registered users and 28 guests