I understand that I might not be too specific in what I want, but I'll try to explain myself as good as I can.
I want to monetize my website, and I'm pretty new to web development. I want everyone except chosen people, to get ads displayed. I have setup mysql accounts etc. and I am trying to detect what rank a session is. What I do atm., is inside of php tags, I get the session, and do
if($_SESSION['category'] == "3"){
I am just wondering, how I would be able to add this code, inside of the brackets of above code. I've tried echo 'CODE'; but I couldn't get it to work. I'd really appreciate any help I can get.
Code I want run:
<script type="text/javascript">//<![CDATA[
(function() {
var configuration = {
"token": "NOT SURE I CAN SHARE THIS",
"excludeDomains": [
"NONE"
],
"capping": {
"limit": 5,
"timeout": 24
},
"entryScript": {
"type": "timeout",
"timeout": 3000,
"capping": {
"limit": 5,
"timeout": 24
}
},
"exitScript": {
"enabled": true
},
"popUnder": {
"enabled": true
}
};
var script = document.createElement('script');
script.async = true;
script.src = '//cdn.shorte.st/link-converter.min.js';
script.onload = script.onreadystatechange = function () {var rs = this.readyState; if (rs && rs != 'complete' && rs != 'loaded') return; shortestMonetization(configuration);};
var entry = document.getElementsByTagName('script')[0];
entry.parentNode.insertBefore(script, entry);
})();
//]]></script>
What I've tried
if ($_SESSION['category' == "3" {
echo '<script type="text/javascript">//<![CDATA[
(function() {
var configuration = {
"token": "NOT SURE I CAN SHARE THIS",
"excludeDomains": [
"NONE"
],
"capping": {
"limit": 5,
"timeout": 24
},
"entryScript": {
"type": "timeout",
"timeout": 3000,
"capping": {
"limit": 5,
"timeout": 24
}
},
"exitScript": {
"enabled": true
},
"popUnder": {
"enabled": true
}
};
var script = document.createElement('script');
script.async = true;
script.src = '//cdn.shorte.st/link-converter.min.js';
script.onload = script.onreadystatechange = function () {var rs = this.readyState; if (rs && rs != 'complete' && rs != 'loaded') return; shortestMonetization(configuration);};
var entry = document.getElementsByTagName('script')[0];
entry.parentNode.insertBefore(script, entry);
})();
//]]></script> ';
}