Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.