Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7652567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:48:15+00:00 2026-05-31T11:48:15+00:00

I would like to know if it’s possible to make pages invisible for users

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:48:17+00:00Added an answer on May 31, 2026 at 11:48 am

    Seems like you have two problems: access control and organization.

    It’d be best to lock access to pages with a rudimentary authentication level programmatically (in PHP, using session data). Otherwise, the most rudimentary form of access control is to restrict with apache’s .htaccess file, but, rules for query string / post can be confusing. See this example: Is it possible to redirect post data?

    Since that kind of locking down is complex, it might be logical to dump AJAX and render full, complete pages instead.

    In either way, what you seem to be conceptually illustrating is a need for separating of content and logic. This is good. However, it’s time to take your development process to the next level.

    Rewrite your code to where only logic and data querying takes place in PHP files. Secondly, output all HTML in your pages by using the Smarty library http://www.smarty.net/docs/en/

    The Smarty templating system is pretty extensible. It has inheritance capabilities so you can produce page variations, template includes, and otherwise run circles around HTML. A handful of Smarty statements can make your life so much easier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i would like know some reference. I know i can googling it. but prefer
I would like know if it is possible to create embedding of audio message
I would like know what is the best possible way to implement transactions with
would like to know how to highlight a gridview row if some object value
Would like to know how it is possible to rewrite www.site.com/?lang=de to www.site.com/de in
I would like to know if it is possible to flip the contents of
I would like to know if it is possible to run nodeunit tests within
I would like to know how do I declare a record, that has some
Would like to know what a programmer should know to become a good at
Would like to know the c# code to actually retrieve the IP type: Static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.