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 7195163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:31:24+00:00 2026-05-28T20:31:24+00:00

I have developped an app (ios and android) that does a php request to

  • 0

I have developped an app (ios and android) that does a php request to a server. For security reasons I need to make sure that a user cant type in the same URL in a browser. Only the app should be allowed to do this request. I have been thinking at doing javascript browser detection and I get a good result for ios where it answers “Unknown” when called from the app. But for android, it always answers “Android”, be it within the browser or when called by the app.
Anyone out there having an idea on how to detect this on the server side?

  • 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-28T20:31:26+00:00Added an answer on May 28, 2026 at 8:31 pm

    You could detect the user agent string. This can be done on the server side in PHP using:

    $_SERVER['HTTP_USER_AGENT']
    

    Android and iOS will return a user agent string containing stuff like “Mobile Safari”, “webkit”, etc. In your app, tell the webview to set the user agent as something proprietary that you’ve made up. You can do this on iOS with the following code – I expect Android has something similar:

    [request setValue:@"MyMadeUpUserAgentString" forHTTPHeaderField:@"User_Agent"];
    

    Then in PHP only show the page if the HTTP_USER_AGENT matches the value you’ve set in your app.

    Of course it’s not massively secure – some browsers or browser plugins let you fake your user agent. But it will stop the vast majority of users from seeing the content in a browser.

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

Sidebar

Related Questions

I'm currently developing an iOS app and have reached the point where I need
I have developed an iOS app that uses CoreData/SQLite. It works, but now I
I have written an iOS app that calls NSUrlConnection multiple times to download image
I have developed a small app that stores locally in iOS through archiving an
I have a small app I've made that I intend to make available on
We have an iOS app which has been approved for release with its version
How do I get started as an Android developer? I know that I need
I have developed an iphone app that needs the email address of a facebook
I have developed an app that has work successfully for the last 4 months
I'm trying to submit my iOS app to the App Store, I have followed

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.