s0c0 Posted July 3, 2007 Share Posted July 3, 2007 I've always been taught to keep my php objects outside of the document root for security purposes, this way they are only accessible to the server. I've been trying to learn ajax as of late and would like to keep doing it this way. The examples I read have me creating a dumb php script (pageA.php for example) that echo's out data from a mysql table to a page and the ajax does a GET and prints this data to the current page (pageB.html for example)? Is there a way to call my existing objects that are outside of apache's documen root and still return using the XMLHttpRequest? Hopefully this has made sense. I'd like to do this myself and not use an existing framework such as saja, I am open to json as my boss has requested i become familiar with it, but id like to get the basics down before learning a framework. Quote Link to comment Share on other sites More sharing options...
s0c0 Posted July 4, 2007 Author Share Posted July 4, 2007 Wow 59 views and not a single reply to even tell me know its not possible to access php files/classes outside the web root with ajax? Quote Link to comment Share on other sites More sharing options...
mainewoods Posted July 4, 2007 Share Posted July 4, 2007 whatever can be in a straight php page can be in a php page called by ajax. an ajax called php page allows you no more access and no less access to your server resources than a straight php page called from the address field of your browser. The only real difference between a php page called from the browser and a php page called from ajax is that the output of ajax called page is returned through the ajax pipe and then has to be injected into the existing page using js. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.