Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,209 members, 7,818,706 topics. Date: Sunday, 05 May 2024 at 10:21 PM

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

Nairaland Forum / Science/Technology / Webmasters / Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? (2180 Views)

Webmasters Quiz :: How To Fix Apache Redirection Bugs / Dhtml Quiz: How Will You Detect If A Browser Support Javascript From Php Code? / Next Php Quiz: How Did I Beat W3c? By Making Html Validate As Xhtml (2) (3) (4)

(1) (Reply) (Go Down)

Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by Nobody: 11:53pm On Mar 08, 2009
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. . .
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by Nobody: 9:42am On Mar 09, 2009
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
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by nitation(m): 6:34pm On Mar 09, 2009
<?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
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by Nobody: 7:29pm On Mar 09, 2009
Outstanding, i will post my full solution later with source codes and online sample when i upload it. . .
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by nitation(m): 8:42pm On Mar 09, 2009
Which I believe my solution should be regarded as second best.

Aiight

- nitation
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by Nobody: 5:50pm On Mar 10, 2009
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. . .
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by nitation(m): 6:40pm On Mar 10, 2009
DHTML you funny gann.

later guys

- nitation
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by Nobody: 6:44pm On Mar 10, 2009
Well, that is just me . . .thanks for the contribution . . .
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by quadrillio(m): 1:24pm On Mar 11, 2009
why is that I dont get to see these questions b4 they are answered, maybe I'll make the webmaster section my homepage.
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by yawatide(f): 3:07pm On Mar 11, 2009
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.
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by nitation(m): 4:16pm On Mar 11, 2009
Was any reason provided for turning off the RSS??

- nitation
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by yawatide(f): 4:21pm On Mar 11, 2009
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
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by Nobody: 1:19am On Mar 12, 2009
This happens to me too. . .i miss out of some threads too . . .
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by Nobody: 1:07pm On Mar 29, 2009
dhtml, you have not explained ur snippet. what do u av in ur session.php
and tell us why u av 2 do it that way.
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by Nobody: 1:15pm On Mar 29, 2009
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. . .
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by Nobody: 7:55pm On Mar 29, 2009
then u must have a way of updating that session variable if the user disabled javascript right after ur check.
Re: Next Quiz: How Do You Detect With Php If Javascript Has Been Turned Off? by Nobody: 8:19pm On Mar 29, 2009
Something like that. . .

(1) (Reply)

APRIL FOOL Pranks, What's The Best You've Seen? / . / I Need A Payment Processor Or Merchant Account.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 18
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.