Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 24, 2009, 07:34 PM
432047 members and 299016 Topics
Latest Member: Magama
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderators: OmniPotens, yawa-ti-de)  |  Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?  (Read 546 views)
*dhtml
Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« on: March 08, 2009, 11:53 PM »

Answers plz. By the way, the answer is not - it is impossible - it is 'cos it has been done before . . .
I need a practicable working solution . . . And it is quite easy too, in fact easier than my last questions. . .
*dhtml
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #1 on: March 09, 2009, 09:42 AM »

No answer yet. . .abi people have gone for public holiday. . .i berra go and look for a date too. . . .be back later in the night. . .thought dis was a giveaway Tongue
nitation (m)
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #2 on: March 09, 2009, 06:34 PM »

<?php
if (isset($_POST['jstest'])) {
  $nojs = FALSE;
  } else {
  // create a hidden form and submit it with javascript
  echo ‘<form name=”jsform” id=”jsform” method=”post” style=”display:none”>’;
  echo ‘<input name=”jstest” type=”text” value=”true” />’;
  echo ‘<script language=”javascript”>’;
  echo ‘document.jsform.submit();’;
  echo ‘</script>’;
  echo ‘</form>’;
  // the variable below would be set only if the form wasn’t submitted, hence JS is disabled
  $nojs = TRUE;
}
if ($nojs){
  //JS is OFF, do the PHP stuff
}
?>

Looking for source, ASK

Note: Make sure you write your code that works fine in the backend and make use of JavaScript for all User Interface enhancements.

- nitation
*dhtml
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #3 on: March 09, 2009, 07:29 PM »

Outstanding, i will post my full solution later with source codes and online sample when i upload it. . .
nitation (m)
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #4 on: March 09, 2009, 08:42 PM »

Which I believe my solution should be regarded as second best.

Aiight

- nitation
*dhtml
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #5 on: March 10, 2009, 05:50 PM »

The most important thing is that it works, i am not particular about a method being 1st best or even second best. First get it to work, then efficiency comes later. Your solution is quite ok.

My solution is somewhat like this:
<script src="session.php"></script> . . . that should be comprehensible to some. . .i will explain in details later. . .
nitation (m)
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #6 on: March 10, 2009, 06:40 PM »

DHTML you funny gann.

later guys

- nitation
*dhtml
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #7 on: March 10, 2009, 06:44 PM »

Well, that is just me . . .thanks for the contribution . . .
quadrillio (m)
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #8 on: March 11, 2009, 01:24 PM »

why is that I dont get to see these questions b4 they are answered, maybe I'll make the webmaster section my homepage.
yawa-ti-de (f)
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #9 on: March 11, 2009, 03:07 PM »

quadrillo, That's right, lol.

I wonder why Seun turned off RSS.  I used to find this very useful.  That way, as quadrillo has said, rather than read everything, I can just monitor posts based on what I see in my RSS feed.

Oh well.
nitation (m)
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #10 on: March 11, 2009, 04:16 PM »

Was any reason provided for turning off the RSS??

- nitation
yawa-ti-de (f)
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #11 on: March 11, 2009, 04:21 PM »

Not that I know of.  It's his site.  It isn't #1 for nothing.  Not that I support it being turned off but I have resolved not to ask Wink
*dhtml
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #12 on: March 12, 2009, 01:19 AM »

This happens to me too. . .i miss out of some threads too . . .
webdezzi (m)
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #13 on: March 29, 2009, 01:07 PM »

dhtml, you have not explained your snippet. what do u av in your session.php
and tell us why u av 2 do it that way.
*dhtml
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #14 on: March 29, 2009, 01:15 PM »

Well, the session.php will be called if the browser can load javascript, then it will start with something like this
<?php
session_start();
$_SESSION['javascript']="enabled";
?>

so that, other php scripts can know that javascript is enabled. . .
webdezzi (m)
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #15 on: March 29, 2009, 07:55 PM »

then u must have a way of updating that session variable if the user disabled javascript right after your check.
*dhtml
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off?
« #16 on: March 29, 2009, 08:19 PM »

Something like that. . .
 How Do Advertise In Yahoo!?  Www.emallng.com  Where To Learn Website Design In Lagos, Nigeria  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.