SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict svcghost's Avatar
    Join Date
    Oct 2010
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ensuring JavaScript

    Hey guys,

    I know JavaScript is client-side, but does anyone have some good resources for ensuring JavaScript is used and used properly with server-side functionalities? I'm really not sure how to search this as I can't really describe it, but do you know what I mean? Making sure JavaScript is enabled and that people don't mess with my JavaScript code on my site or take advantage of it. I use PHP

  2. #2
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can tell PHP if JS was enabled after some interaction, such as submitting a form, but when the page is first generated PHP won't know. And even for subsequent actions there is no way to ensure the user hasn't modified your JS.

  3. #3
    SitePoint Evangelist smftre's Avatar
    Join Date
    Dec 2008
    Location
    London
    Posts
    436
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should extend functionality using JS, not use it for the main functionality.
    So don't rely on any security measures to be performed using JS at all, no login attempts, nothing. Rather have that hard coded that PHP will check it no matter what. You can always use JS to do checks prior to submission or whatever you like as a "nice feature", but do not use JS as the only checking point.

    Can you describe your reason for needing to know if users have modified your JS? Is it some security concern? Secure token that is sent etc?
    Statvoo.com The Website Traffic Monitor
    The best way to monitor traffic to your sites for free!


    Web Development London UK We make web 3.0 applications


Bookmarks

Posting Permissions

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