SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    May 2003
    Location
    virginia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    web resources (display image from binary etc.)

    Hi,

    I'd like to find a way to have my entire application self-contained. In the past I've had all of my php code above the web root in a special directory. I'd also like to have all of the web resources like images, javascript and css out of the web root also. I've figured one way of doing this... create a http script that handles incoming requests for resources and let it do the file handling, header and outputting. Example:

    <link href="web.php?src=default.css"></link>
    <img src="web.php?src=logo.gif"/>

    Is there any other way?

  2. #2
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think it's a good idea to read all files with a script to output to the browser. Try .htaccess instead, but only if you need to.
    Because what I don't understand is that you want to put all your files in a parent directory of the sites root. Why do you want that?

    If you're afraid a user with ftp access will delete the files you've uploaded, you just create another ftp account locked into a child directory of the sites root.
    FOR SALE: 1 set of morals, never used, will sell cheap


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
  •