PHP and XML

Discussion in 'PHP' started by XandroZ, Jul 26, 2007.

  1. #1
    I use PHP to access a XML data file. I don't want that XML to be access by browser(see) access only data with php. How to block the access to the XML for everithing else except the PHP file?
     
    XandroZ, Jul 26, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    htaccess.

    
    <FilesMatch "\.xml$">
        deny from all
    </FilesMatch>
    
    Code (markup):
     
    nico_swd, Jul 26, 2007 IP
  3. Brewster

    Brewster Active Member

    Messages:
    489
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Or you could put the xml below the public_html folder

    Brew
     
    Brewster, Jul 26, 2007 IP
  4. XandroZ

    XandroZ Peon

    Messages:
    395
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I don't have htaccess. Create on file with this name for the apache in the public section?
     
    XandroZ, Jul 26, 2007 IP