How to block mobile or smartphone browser access for clock in/out functions in

Posted on 2012-09-18
Last Modified: 2012-09-20
We've created a clock in/clock out page built using in vb, and we are trying to see how to add controls to block it for users trying to access the page on mobile browsers or outside networks.

We know we can restrict it to a single IP address, however, the organization the IP belongs to frequently changes their network IP  (as we've been told).

Any code set would be of help.

Please let me know if you have any further questions.

Question by:bpatton_psr
    LVL 83

    Assisted Solution

    One option is to look at the user agent string. But it could be faked on droids.
    LVL 23

    Accepted Solution


    Try this website -

    Hope it helps u...
    LVL 25

    Assisted Solution

    A really simple trick would be to create a style sheet rule after all your other CSS data that hides the page for mobile devices.  Like this...

    	<style type="text/css" media="screen">
    	  normal CSS stuff here...
    	<style type="text/css" media="handheld">
    		body { display: none; }
    		html { display: none; }
    		input { display: none; }

    Open in new window

    I haven't actually tried this, and it MIGHT affect a few handheld devices such as tablets, but its no worse than checking for a user agent string, which as CodeCruiser rightly points out could be easily faked.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now