I would like to know if it's possible to make pages invisible for users with .htaccess or something else.
Some background info and some other questions :
I'm building a web application which does a lot of dynamic content loading. At the moment i'm just doing ajax calls on a ajax.php file and i give a POST parameter with the name : action. Depening on this action I call a method of a class, this class then echo's JSON or HTML.
But i'm starting to get at the point, that i have functions who return almost a complete html page (SQL and php in between) which kinda looks dirty. Is it a better option to build seperate .php pages for this content, and then load the content just from that page? (I use Jquery, so that would be the .load function as call back)
The problems i see with this method is that people can find those .php pages and access them, and then see information that's not relevant and has no lay out or something. So i want to block these pages. How do I do this with .htaccess?
Now if u think i'm doing stuff completely wrong, just tell. A basic situation in my implementation : Fill in a client number in a search form -> press enter -> ajax call with post parameters action : getclientinfo , id : the value in the field -> ajax.php gets the correct class and method -> .class.php executes his method and checks if the input is ok, if so it constructs a page with content from the database -> All this gets returned as JSON something like :
{ success : OK; content : the complete content }
-> then with jquery i check the success boolean, and then load the complete content into the current page.
Is this a good method, or am i doing things bad ? The thing i'm not feeling myself ok with, is the ajax.php page. What's usually done ?
Thanks in advance. I got many answers from this website, first time ever I'm asking one myself.