How to deny/block a url from the address bar?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Easytime
    New Member
    • Nov 2012
    • 26

    How to deny/block a url from the address bar?

    Dear Brothers,

    thank you all for your magnanimous support in this forum.
    I need you to help me again on some issues.
    1. I want to block some url(pages) from being loaded through the address bar of the browser...i.e., when the users of my pages try to access a particular page by typing its url on the address bar, the server should display an error message like..'LOGIN TO ACCESS THIS PAGE!'


    Thank you.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    That's not really something you can control. There is really no difference between getting to a page by clicking a link, or by typing in the URL. (Except perhaps the REFERER header, but that's hardly reliable.)

    What you can do, however, is use the session to manage people's login status, and check that when people enter those pages.

    Why do you want to restrict people from entering the URL directly anyway?

    Comment

    • Easytime
      New Member
      • Nov 2012
      • 26

      #3
      I want to develop a facebook-like app that will require people to register before being able to access the functions. So, for non registrants, there will be no access to the pages except through login page.

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        It very much sounds like you are just asking about typical user login systems. There are literally hundreds of articles, tutorials and forum threads available via Google that discuss various techniques for making that happen. They all basically just restrict access to pages, and redirect to a login/registration form, if a user has not already logged in. Usually this involves the use of sessions and/or cookies to maintain the user login.


        No offence but judging by your reply, I can tell that you are nowhere near ready to develop a Facebook-like application. Social networking sites are relatively complex, as far as CMS software goes, and really should not be attempted by novices. They require a fair bit of experience with PHP development to be worth the effort.

        I don't mean to discourage you from learning, but I do suggest that you start with something simpler to begin with. Otherwise you're likely to frustrate yourself into dropping the whole thing. And in the unlikely case that you do manage to finish the site, it won't be as secure or efficient as it would have to be to be usable.

        To put this into perspective. Facebook itself is developed by a large team of expert PHP developers. Most halfway successful social networking sites, likewise, are developed by teams of experts in their respective languages. None of them would have succeeded if created otherwise.

        This is not a good project to use to learn the basics of PHP development.

        Comment

        • Easytime
          New Member
          • Nov 2012
          • 26

          #5
          You do not still understand....A m not developing a facebook app...but something close to it...I have developed a desktop app for church management...I want to have the same app in a web format...that, churches can rather sign-up accounts, and manage their programmes and events. Now, you see, there are about 2 if not 3 levels of authentication. ...there is the login page to their individual church pages.... and there is also, the login to the different functional pages from their individual pages... there are individual pages just like facebook pages...not necessarily to have the social functionality.. ..although, this will come in the future, but not for now....I can do this app with visual basic professional as a desktop which I have already done....but I want to use php and do a web based type...I can also use asp.net but I do not want to, bcos, there are browser limitations and the rest...so, please kindly assist me in any way....even if it means paying you to run some scripts for me, let me know. Thank you.

          Comment

          • Atli
            Recognized Expert Expert
            • Nov 2006
            • 5062

            #6
            OK, you right. It seems that I don't really understand what you are trying to accomplish there. But pretty much all login functionality works the some for online applications. You have a login/registration form that people use to login in or sign up. Once they are logged in, that fact is stored in a Session value, so that each time they open a page the session value can be checked to see if the user is logged in. Any sort of group or role layout for different areas of the site are built on top of this. - I suggest you go look for tutorials on user logins to get the basics. You can then build your specialized login system on top of that knowledge.

            As for using ASP.NET. Why do you think there are browser limitations to that? ASP.NET is just like PHP; a server-side language used to serve HTML content. You can make that HTML content whatever you want, so there really are no limitations on what browsers can be used with it. If you feel more comfortable using VB.NET, you may well want to use that instead of PHP. Of course, these types of user login systems work essentially the same there as in PHP, except they use different functions and libraries. (There may actually be built in controls for this in the old ASP.NET Web Forms library, but I don't really know much about that.)

            Comment

            • Easytime
              New Member
              • Nov 2012
              • 26

              #7
              Yeah, concerning ASP and ASP.NET, you know that, they use vbscript mostly. But vbscript has some browser disadvantages - microsoft only developed vbscript to run on IE only. So, some browsers might not currently run vbscript....I don't know about present versions of most browsers...but, that's just a little I know about vbscript with browser disadvantages.. However, Atli, what do you think about the idea I got? Can I chat with you one-on-one?

              Comment

              • Atli
                Recognized Expert Expert
                • Nov 2006
                • 5062

                #8
                That's simply not true. ASP.NET does in no way rely on the old VBScript language, or other old Microsoft stuff like ActiveX components. Like I said, ASP.NET is much like PHP in that it is a server-side language. You control what content it servers to the client; whether it servers VBScrip or normal Javascript.

                Very few websites of any kind, except perhaps some very limited, in-house applications, rely on VBscript or ActiveX. Most APS.NET based websites in the wild will just server normal HTML/CSS and Javascript.


                As for the one-on-one chat, I'm sorry but I've got way to much on my plate as it is. If you want to hire somebody to help you, there are plenty of PHP developers out there that would no doubt be more than happy to join you.

                Comment

                • Easytime
                  New Member
                  • Nov 2012
                  • 26

                  #9
                  how do I get to these php developers? can you suggest a few? Thanks.

                  Comment

                  Working...