Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    mypointofview
    Guest

    Quick question about site structure using php

    I'm converting my site to php from html. I have some questions since PHP is still a bit fresh for me...

    I'm not using any arrays or such, just simple files, real simple, just not with .html at the end but .php.

    I noticed that when giving out a link, like "www.domain.com/page" (where "page" is actually a "page.php" file) - then the browser would not resolve this automatically (403 error)

    So I thought of doing this: I'd rename "page.php" into "index.php" and put it into a folder called "page". Then the visitor's browser would nicely resolve the URL.

    Is this a good idea to organize my site ?

    Also: would I have to put the "php.ini" file into every such folder (it seems that php works only if the php.ini file exists on the same level as the php page)

    Thanks, Martin.

  • #2
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    845
    Thanks
    15
    Thanked 10 Times in 10 Posts
    Quote Originally Posted by mypointofview
    I'm converting my site to php from html. I have some questions since PHP is still a bit fresh for me...

    I'm not using any arrays or such, just simple files, real simple, just not with .html at the end but .php.

    I noticed that when giving out a link, like "www.domain.com/page" (where "page" is actually a "page.php" file) - then the browser would not resolve this automatically (403 error)

    So I thought of doing this: I'd rename "page.php" into "index.php" and put it into a folder called "page". Then the visitor's browser would nicely resolve the URL.

    Is this a good idea to organize my site ?

    Also: would I have to put the "php.ini" file into every such folder (it seems that php works only if the php.ini file exists on the same level as the php page)

    Thanks, Martin.
    When you type in an address such as "www.utexts.ca/thepage", it will not go to "thepage.php" it will go to "thepage" the directory, if there is such a directory.

    The organization of a site depends on how the user feels about it (you). Such as directory structures and that it is the preference of the designer, since you are the one linking, making, creating pages. I like keeping all my pages in one directory, imgs in a different once, js in another, etc... but that is just me.

    You shouldn't have to put the php.ini file in every directory. The php.ini file is read by the webserver when it first launches and thus will do nothing except expose your php settings to the world.
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com

  • #3
    mypointofview
    Guest

    php.ini exposed ?!

    The php.ini file is read by the webserver when it first launches and thus will do nothing except expose your php settings to the world.
    Wow -- I just realized that indeed anybody could see my php.ini by typing www.mydomain.com/php.ini.

    So, can that be exploited by bad guys??

    Should I perhaps chmod it in a particular way? When going to apple.com/php.ini I can't read theirs -- so are they perhaps more clever than me ... ... of course I guess so!

    Martin

  • #4
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    845
    Thanks
    15
    Thanked 10 Times in 10 Posts
    Quote Originally Posted by mypointofview
    Wow -- I just realized that indeed anybody could see my php.ini by typing www.mydomain.com/php.ini.

    So, can that be exploited by bad guys??

    Should I perhaps chmod it in a particular way? When going to apple.com/php.ini I can't read theirs -- so are they perhaps more clever than me ... ... of course I guess so!

    Martin
    I am sure anything can be exploited by anyone who know how to do so...

    Most webservers (plus the PHP installation) does not put the php.ini file in your public directory, as it is a very bad idea.
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com


  •  

    Posting Permissions

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