«Home

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

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. . .

Avatar
Newbie
14 answers

Something like that. . .

0
Avatar
Newbie

then u must have a way of updating that session variable if the user disabled javascript right after ur check.

0
Avatar
Newbie

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. . .

0
Avatar
Newbie

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.

0
Avatar
Newbie

This happens to me too. . .i miss out of some threads too . . .

0
Avatar
Newbie

Was any reason provided for turning off the RSS??

- nitation

0
Avatar
Newbie

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.

0
Avatar
Newbie

why is that I dont get to see these questions b4 they are answered, maybe I'll make the webmaster section my homepage.

0
Avatar
Newbie

Well, that is just me . . .thanks for the contribution . . .

0
Avatar
Newbie

DHTML you funny gann.

later guys

- nitation

0
Avatar
Newbie

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. . .

0
Avatar
Newbie

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

Aiight

- nitation

0
Avatar
Newbie

Outstanding, i will post my full solution later with source codes and online sample when i upload it. . .

0
Avatar
Newbie

<?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

0
Avatar
Newbie
Your answer
Add image

By posting your answer, you agree to the privacy policy and terms of service.