title: I cannot make php to replace a <p> text by my $_SESSION['userlogged'] value
body: <p>I have tried</p>
  <pre><code>&lt;?php session_start(); ?&gt;
  </code></pre>
  <p>.
  .
  .</p>
  <pre><code>&lt;p&gt;&lt;?php $_SESSION['loggeduser']; ?&gt;;&lt;/p&gt;
  </code></pre>
  <p>I have also tried this JS after the </p></p>
  <pre><code>    &lt;script type=&quot;text/javascript&quot;&gt;
          let vuser = '&lt;%= session.getAttribute(&quot;loggeduser&quot;) %&gt;';
          document.getElementById(&quot;userid&quot;).value= &quot;Not set&quot;;
      &lt;/script&gt;
  </code></pre>
  <p>If someone can tell me what am I doing wrong please!
  This is my full body code:</p>
  <pre><code>        &lt;body&gt;
          &lt;section id=&quot;MyHeader&quot; style=&quot;border:solid red thin;&quot;&gt;
          &lt;div id=&quot;TheHead&quot; style=&quot;width:80%; display:inline-block;&quot;&gt;
          &lt;div id=&quot;HeadImg&quot; style=&quot;width: 100px; height:100px;&quot;&gt;
              &lt;a href=&quot;main.html&quot;&gt;
                  &lt;img src=&quot;../images/icon-redcross.png&quot; alt=&quot;AGR&quot;&gt;
              &lt;/a&gt;
          &lt;/div&gt;
          &lt;div id=&quot;HeadLegend&quot;&gt;
              &lt;div id=&quot;AGRbrand&quot;&gt;&lt;h1&gt;AGR&lt;/h1&gt;&lt;/div&gt;
              &lt;div id=&quot;quote&quot;&gt;
                  &lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;Properties catalogue&lt;/i&gt;&lt;/span&gt;
              &lt;/div&gt;  
          &lt;/div&gt;
          &lt;/div&gt;
          &lt;div id=&quot;user&quot; style=&quot;display:inline-block; width:12%; height:25px;&quot;&gt;
          &lt;p id=&quot;userid&quot; style=&quot;width:100%;&quot;&gt;&lt;?php $_SESSION['loggeduser'];?&gt;&lt;/p&gt;
          &lt;script type=&quot;text/javascript&quot;&gt;
              let vuser = '&lt;%= session.getAttribute(&quot;loggeduser&quot;) %&gt;';
              document.getElementById(&quot;userid&quot;).value= &quot;Not set&quot;;
          &lt;/script&gt;
          &lt;/div&gt;                          
          &lt;div style=&quot;width:100%; display:block;&quot;&gt;
          &lt;div id=&quot;MenuButtons&quot; style=&quot;width:80%; display:flex; justify-content:right;&quot;&gt;
              &lt;div id=&quot;newbtn&quot; class=&quot;TopButton&quot;&gt;&lt;a href=&quot;New.html&quot;&gt;New&lt;/a&gt;&lt;/div&gt;
              &lt;div id=&quot;exitbtn&quot; class=&quot;TopButton&quot;&gt;&lt;a href=&quot;../index.html&quot;&gt;Exit&lt;/a&gt;&lt;/div&gt;
          &lt;/div&gt;          
          &lt;/div&gt;
          &lt;div class=&quot;Subtitle&quot;&gt;
          &lt;div style=&quot;display: flex; justify-content: left; width:100%;&quot;&gt;
              &lt;h4&gt;Properties&lt;/h4&gt;
          &lt;/div&gt;
          &lt;/div&gt;  
          &lt;/section&gt;  
          &lt;div id=&quot;Estates&quot; class=&quot;pagebreak&quot;&gt;&lt;/div&gt;
          &lt;section id=&quot;MyPage&quot;&gt;
          &lt;div id=&quot;Home&quot;&gt;&lt;/div&gt;     
          &lt;div class=&quot;page&quot; style=&quot;width:100%; background-color: white; &quot;&gt;
              &lt;div style=&quot;display: flex; justify-content:center; width:100%;&quot;&gt;
                  &lt;div class=&quot;ServiceBox&quot;&gt;
                      &lt;div class=&quot;div-img&quot;&gt; 
                      &lt;img src=&quot;../../images/house-B.png&quot; alt=&quot;AGR&quot;&gt; 
                  &lt;/div&gt;  
                  &lt;div class=&quot;div-info&quot;&gt;
                  &lt;/div&gt;  
                  &lt;div class=&quot;div-desc&quot;&gt;
                  &lt;/div&gt;  
                  &lt;div class=&quot;div-btns&quot;&gt;
                      &lt;a class=&quot;SideButton&quot; href=&quot;Edit.html&quot;&gt;Edit&lt;/a&gt;
                      &lt;a class=&quot;SideButton&quot; href=&quot;Delete.html&quot;&gt;Delete&lt;/a&gt;
                      &lt;a class=&quot;SideButton&quot; href=&quot;pdf-file.html&quot;&gt;Pdf&lt;/a&gt;                      
                 &lt;/div&gt;                   
              &lt;/div&gt;      
          &lt;/div&gt;      
          &lt;/div&gt;
          &lt;/section&gt; 
          &lt;/body&gt;
  </code></pre>
  <p>Notes: $_SESSION[&quot;loggeduser&quot;] is populated before this page,at the login page; I verified the variable was properly set by a log file I have, and I was able to see the value printed in the log, after the user logs in and before this page is loaded.</p>