Re: include, relative path



On May 23, 5:01 pm, Michael Fesser <neti...@xxxxxx> wrote:
.oO(^AndreA^)

Guys, sorry for my lateness... Thank you very much for your answers!

At the end I did simple:
include '../libraries/db_details.php';

It seems so simple and sounds strange to me that I didn't try it... I
really don't know what I was thinking that day... ;-)

An absolute path based on $_SERVER['DOCUMENT_ROOT'] would still be the
better and more reliable choice. You also should keep your library
_outside_ the document root for security reasons.

Micha

mmm... interesting...
I didn't use $_SERVER['DOCUMENT_ROOT'] because include '../libraries/
db_details.php'; sounded simpler and also it works on my localhost and
also on the server online so I didn't bother so much... but I'll have
a look on the internet to understand the advantages...

For what regarding security reasons I'm pretty curios, you say I
should keep my library outside the document root...
1) How could I do that?!?
Where do I have to place it and also how to get it outside of the
document root?
2) Why for security reasons?!?
Nobody can reach my php scripts on the server... or not?
i.e. I could even write a clear password on a php file... right?!?

Andrea
.



Relevant Pages

  • Re: Larkin, Power BASIC cannot be THAT good:
    ... Some days you might see a dozen posts from one wannabe security ... researcher who just went looking for the most obvious bugs in PHP scripts, ... I had in mind jobs which are essentially turning the rubbish formatted dump of raw data that some manufacturer outputs into a format that is useful to their customer. ... You would not believe the number of expensive instruments that output measurement data in the most user hostile and bulky formats possible. ...
    (sci.electronics.design)
  • How to update a database row from a form?
    ... Though I program in php for some years, I started thinking a lot about the security in my php scripts. ... When I add/insert/delete to a form I usually have a hidden input box with the of the record I want to update. ... This is quite a security risk but these forms are administration forms, assuming that the administrator won't edit hidden values and mess with it's data. ...
    (comp.lang.php)
  • Re: How to update a database row from a form?
    ... the security in my php scripts. ... This is quite a security risk but these forms are administration forms, ... Howzabout using a basic crypt function (with a key embedded in the php ... script) to encrypt the ID of the record for display as a hidden field. ...
    (comp.lang.php)
  • Re: Larkin, Power BASIC cannot be THAT good:
    ... flaws than buffer overflows ever have. ... Some days you might see a dozen posts from one wannabe security ... researcher who just went looking for the most obvious bugs in PHP scripts, ... half-arsed job so much easier than doing it right. ...
    (sci.electronics.design)