SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    fulham
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    very simple problem

    I feel a little ashamed that I dont know this but here goes

    I want to have my "connect.inc" file on the root of my hosting space and then link all my php files to it.

    I can do it in the "/pulic_html/" folder using "../connect.inc" but if I go higher, say "/public_html/admin/" I have no idea how to link to it.
    Cheers

    Coup

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2005
    Location
    Venlo, the Netherlands
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ../../connect.inc

    but DONT use .inc as your extension!
    If you do people can just go to your www.domain.dom/connect.inc and see all the details they need to 'hack' into your database.
    It would be better to call the file connect.inc.php, because that way the data in variables won't be parsed.

  3. #3
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    for every folder you go into use ../
    so if it was in /public_html/admin/ it would be ../../connect.inc
    if it was /public_html/admin/pages/ it would be ../../../connect.inc

    Cheers

    SpikeZ

    EDIT: oooh vinnie! I agree with vinnie about the .inc extensions, big security risk

    S
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  4. #4
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    fulham
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers spikeZ & Vennie that worked a treat!!!
    Cheers

    Coup


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •