Jump to content

[SOLVED] echo a div


justAnoob

Recommended Posts

Hi everyone. I am trying to hide a div until someone is authenticated on my page. This is what I have so far. Oh,, by the way, it doesn't work. LoL.

   <div id="admin"><img src="--------/---------.png" alt="admin" width="28" height="32" />
    	<?php
session_start();	
if(isset($_SESSION['auth']))
{
     echo <div id="admin">;
} 
?>
    
    </div>

Link to comment
https://forums.phpfreaks.com/topic/143431-solved-echo-a-div/
Share on other sites

Well gevans, I'm not sure if you were trying to tell me this, but I found something that works.(so far) I put this on the top of my page.

<?php
session_start();  
if(isset($_SESSION['auth']))
{
   	echo '<div id="reguser"><img src="------/------.png" alt="home" width="32" height="32" /></div>';
} 
?>

And then also I just positioned my div on the page where I wanted it and just kept it empty, like this

<div id="reguser"></div>

Maybe that is what you were explaining. Well anyways, maybe this can help someone else out in the future. Thanks again fellow PHPers. Oh yeh, the div name I changed after everything was working ok. That did not play a part with this not working, just to let everyone know.

Link to comment
https://forums.phpfreaks.com/topic/143431-solved-echo-a-div/#findComment-753026
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.