PHP and XML

Reply

Join Date: Sep 2006
Posts: 26
Reputation: Alexandro is an unknown quantity at this point 
Solved Threads: 0
Alexandro Alexandro is offline Offline
Light Poster

PHP and XML

 
0
  #1
Jul 26th, 2007
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?
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: PHP and XML

 
0
  #2
Jul 26th, 2007
You'll need to use .htaccess to block that file. If your XML files all have a .xml file extension this oughta do it:

  1. # Block all .xml files from being viewed through a web browser
  2. <Files ~ "\.xml$">
  3. Order allow,deny
  4. Deny from all
  5. </Files>
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 26
Reputation: Alexandro is an unknown quantity at this point 
Solved Threads: 0
Alexandro Alexandro is offline Offline
Light Poster

Re: PHP and XML

 
0
  #3
Jul 26th, 2007
if I don't have a htdocs I create one myself in the public area ?
This block also the search engines or i have to use a robot.txt file?
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: PHP and XML

 
0
  #4
Jul 26th, 2007
This will block everyone. It goes in a file called .htaccess and it needs to be in your root directory.

Keep in mind that no one can find these files unless you someone have their location in your source code. Otherwise the odds of someone finding them will be small.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 26
Reputation: Alexandro is an unknown quantity at this point 
Solved Threads: 0
Alexandro Alexandro is offline Offline
Light Poster

Re: PHP and XML

 
0
  #5
Jul 26th, 2007
It is not about finding them in the source code, I want the acces to see to be block for everithing, with the exception of the PHP file the acces the file, like a sql database with a password.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: PHP and XML

 
0
  #6
Jul 27th, 2007
I understand why you want to do it. I just wanted to let you know the odds of anyone finding those files is very remote.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC