Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop loading PHP page if javascript is not enabled [duplicate]

I am trying to stop loading my php page if the javascript is not enabled on user's computer.

below method working fine. However please let me know is it cross browsered and is it safe?

<noscript>
<?php
echo "Please Enable JavaScript in your browser!";
exit;
?>
</noscript>

  <div id="main">
    <!-- #header -->
    <div id="header"> 
        <div id="logo"><a href="homepage.php" title="Go to Homepage"><span><?php echo $Name;?></span></a></div>.....

Please let me know anyother professional way I can do it.

PS: Some of my user tried to disable JavaScript after page load. This thing also affect some of my pages. I am getting wrong values on submit since the js disabled. I wanna overcome this situation please.

like image 738
user1854007 Avatar asked Nov 30 '22 04:11

user1854007


1 Answers

You can insert the tag

<title>Your title</title>    
<noscript><meta http-equiv="refresh" content="0; URL=/badbrowser.html"></noscript>
like image 162
Konstantin Avatar answered Dec 04 '22 11:12

Konstantin