SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Is it possible

  1. #1
    SitePoint Evangelist barbara1712's Avatar
    Join Date
    Apr 2007
    Location
    India
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is it possible

    Hello Guys,


    In php ,how do I know weather javascript is enabled or not?

    Thanks in adv,
    Barbara

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Simply put, you don't. What is the reason for you needing to know if JavaScript is enabled.
    Kayzio - We don't hesitate, we accelerate.

  3. #3
    SitePoint Enthusiast Chousho's Avatar
    Join Date
    Jun 2006
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, maybe you could.

    Write some javascript to set a variable to some value. With PHP check if that variable is set to the value it should be, or not.

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Chousho that wouldn't work b/c PHP executes before JavaScript.
    Kayzio - We don't hesitate, we accelerate.

  5. #5
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As i had read in some internet page but i have not tested it yet if you could learn something from the following statement:
    the only way I know of is to set a test cookie, then reload the page (or go to a new one) and test to see if the cookie was set.
    i.e. set the cookie when user goes to login form and on submission check if it was set.
    There was nothing more to read. If you can find some idea from above statement, please let me know too.

    Good luck.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  6. #6
    SitePoint Addict
    Join Date
    Jan 2007
    Location
    Romania
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rajug View Post
    As i had read in some internet page but i have not tested it yet if you could learn something from the following statement:

    There was nothing more to read. If you can find some idea from above statement, please let me know too.

    Good luck.
    If you create a cookie in Javascript you can read it in PHP. If the cookie is set then Javascript is enabled. You can find here how to read and write cookies in Javascript.

  7. #7
    SitePoint Evangelist barbara1712's Avatar
    Join Date
    Apr 2007
    Location
    India
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Guys,

    here is the link to check the javascript is enabled or not.
    check javascript enabled or not

    Thanks to all for replies.
    Barbara


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
  •