I am working on my PHP/MySQL
server (website really just a PHP server), and I want to switch from PHP
echoing to JavaScript
writing something. I want this because the following reasons.
1: JavaScript is easier on my page, and
2: because for some reason PHP echoing breaks my navigation bar but JavaScript don't. Could I do something like this but tweak it to tell whether it DOES or DOESN'T exist?
THIS IS MY CODE:
<script>
document.cookie = "username='<?php echo $_SESSION['username'] ?>';";
var u = document.cookie;
document.getElementById("username").innerHTML = u();
</script>