/    Sign up×
Community /Pin to ProfileBookmark

How to restrict users ?

Hello there,

I’m building a web application using PHP, and I want to let it be accessed through PDAs only, like iPhone, htc, … and not let the user access it through PC, can any one help me with that, I’ve been searching the net and posting my query in many websites but no one gave me the solution.

Thanks in advance

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 15.2009 — You could try using the [url=http://www.php.net/get_browser]get_browser[/url]() function. Neither this nor any other server-side solution will be bullet-proof since it is easy for any tech-savvy user to change the User-Agent header sent by his browser.

Another solution would be to simply use CSS media types to control what gets displayed. Again, this will not stop a tech-savvy user from viewing the content if he's on to what you're doing, but would work in the vast majority of cases.
Copy linkTweet thisAlerts:
@JutmeauthorApr 17.2009 — I know that the solutions you told me about won't be bullet-proof, but for example when I try opening the following web site on my iPhone it is working, but trying to open it on the PC, I get a message on the website telling me that this website is designed for the iPhone, this is what i want to have for my application.

The website:

http://www.southparkmobile.net/
Copy linkTweet thisAlerts:
@NogDogApr 17.2009 — It appears to be using the user-agent HTTP header ($_SERVER['HTTP_USER_AGENT']). If I change the user-agent in Firefox via the [url=https://addons.mozilla.org/en-US/firefox/addon/59]User Agent Switcher add-on[/url] as described in this article, then I can view the page in Firefox.
Copy linkTweet thisAlerts:
@JutmeauthorApr 17.2009 — I see now...

So those websites (like: hotmail, facebook,...) that are surfed using the iPhone or mobile windows pocket PC, will be redirected to the desired page which are made specially for them, using the get_browser() function which will return the capabilities of the user's browser and redirect it to the desired page.

What i thought that those websites will check the MAC address of the device, whether it was an iPhone or mobile windows pocket PC or any other device, and depending on that it will browse the website.

Thanks for the help NogDog ?
×

Success!

Help @Jutme spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...