www.webdeveloper.com
Results 1 to 4 of 4

Thread: Access php script from applet ONLY

  1. #1
    Join Date
    Jun 2009
    Posts
    23

    Access php script from applet ONLY

    Hi,
    I'm going to have an applet that is hosted on remote server (call it http://server.com/appletpage.html) which is going to access a php script on the same server (http://server.com/script.php). Is it possible to make it so that only the applet has access to the PHP script, and calling the script from a browser or an external program wouldnt work? If so how would I go about it. I just want to protect the script from external invocation. Is there an alternative to what Im trying to do?

    Alex

  2. #2
    Join Date
    Jan 2009
    Posts
    3,346
    You can use a token when accessing the php script from the applet though a clever user could sniff the packets and replicate it. Maybe this is a band-aid to a different problem though. What does the php script do that you would only want the applet to have access to?

  3. #3
    Join Date
    Jun 2009
    Posts
    23
    it is a tile-based game and actually I have about 20 scripts. Some of those scripts retrieve game data, others save it. I also was thinking about passing a code as one of the parameters.
    Ok, thanx.

  4. #4
    Join Date
    Jan 2009
    Posts
    3,346
    Your best bet is to use some sort of authentication (just like regular user management) and then pass a session id with each request. This way your applet "logs in" and then can use the different files easily without re-authenticating. This would also help to hide a little better the method used to prevent outside use of the scripts plus it would set you up for opening up an API for third-party development should you desire.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles