Jump to content

[SOLVED] document root


asmith

Recommended Posts

i've read to put sql and other important information outside of the document root a few  times.

for achiving this i only need to put ../  ?  like :    http://www.domain.com/../password.php

?

can't a user just type  http://www.domain.com/../password.php in a download program and get it ?

or i got whole wrong ?

(sorry , i know it is not a full php question)

Link to comment
Share on other sites

I've often wondered this too. I used sessions to check whether a user was logged in as an admin when they tried to guess a URL and then redirected to login.php if they wern't logged in.

 

There surely will be a better option though. SSL sites must have some kind of method to stop this.

Link to comment
Share on other sites

so for example  :  if i save all mysql and passwords into  emmm security.php . 

then i include them in a script ? 

like:

 

 

<?php
include("http://www.domain.com/../security.php");

 

is that right ? or i have to cinfigure some setting too ?

Link to comment
Share on other sites

ok .

so no configure needed,

another thing,

is this needed to do such coding :

 

<?php
$a = true;
include("../security.php");

security.php

<?php
if (!isset($a))
{exit;}


// the codes 

unset($a);

 

 

i mean this way for preventing someone to access security.php individually .

but as talking about the path outside the root ,

is that nessery now ?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.