Is this correct? If not what is the correct syntax
I am new to php hence trying to learn.
<noscript>
<?php
//do the include thing right here
$a=1;
?>
</noscript>
<?php
if(isset($a)){
//do nothing
}else {
//add the include u want
};
<?
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.
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>
It won't work, because <noscript>
induces a behavior in the browser, and you are checking your condition server side.