PHP &

后端 未结 10 1801
误落风尘
误落风尘 2021-01-20 13:40

Is this correct? If not what is the correct syntax

I am new to php hence trying to learn.

    

        
相关标签:
10条回答
  • 2021-01-20 14:09

    how about ?

    <noscript>
    <?php 
    //do the include thing right here 
    $a=1;
    ?>
    </noscript>
    <?php
    if(isset($a)){
    //do nothing
    }else {
    //add the include u want 
    };
    <?
    
    0 讨论(0)
  • 2021-01-20 14:10

    No that is not correct. All code is interpreted, and why are you using string literals instead of actual booleans? And not to mention, you're using an assignment operator instead of a comparison operator in your if statement.

    0 讨论(0)
  • 2021-01-20 14:14

    To accomplish this (if you really need to know from PHP if the user has JS enabled) :

    <script>
    // AJAX call to your PHP script to tell it that JS is enabled
    </script>
    
    0 讨论(0)
  • 2021-01-20 14:20

    It won't work, because <noscript> induces a behavior in the browser, and you are checking your condition server side.

    0 讨论(0)
提交回复
热议问题