Jump to content

Sessions: Show if ...


Deon

Recommended Posts

Hi there,

This is my 1st attempt with the following in PHP. Here is the code in ASP:
<% if Session("MM_Username") = "" then %>
Visitor!
<%End If %>
<% if Session("MM_Username") <> "" then %>
<!--#include file="../includes/incl_logout.asp" -->
<%End If%>

How does this look in PHP? I have no idea and it seems that no one can help me out.

This is the same as with this forum. When I am not logged in, the login option shows. When I am logged in, My name together with the Log Out option shows. I have noticed that with this forum it is done with different <div> tags, but it does not need to be the same with my script.

I will really appreciate your help.

Regards,
Deon
Link to comment
https://forums.phpfreaks.com/topic/10167-sessions-show-if/
Share on other sites

If you are familiar with ASP, you should be able to easily conver this code to php. Just a slight chage of syntax.

[code]<?php
if (!isset($_SESSION['MM_Username']))
{
?>
Visitor
<?php
}
else
{
     include('../includes/incl_logout.php');
}
?>[/code]

That is pretty much the same code that you have gave me, but in php.

[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--]
Link to comment
https://forums.phpfreaks.com/topic/10167-sessions-show-if/#findComment-37901
Share on other sites

[!--quoteo(post=375986:date=May 22 2006, 10:55 AM:name=jeremywesselman)--][div class=\'quotetop\']QUOTE(jeremywesselman @ May 22 2006, 10:55 AM) [snapback]375986[/snapback][/div][div class=\'quotemain\'][!--quotec--]
If you are familiar with ASP, you should be able to easily conver this code to php. Just a slight chage of syntax.

[code]
<?php
}
else
{
     [color=#CC0000]include('../includes/incl_logout.php')[/color];
}
?>[/code]

[/quote]

Jeremy,
how can I insert a table in the red coded space. When I try to just insert a table there, I get errors of missing omjects.

Regards,
Deon


[!--quoteo(post=375986:date=May 22 2006, 10:55 AM:name=jeremywesselman)--][div class=\'quotetop\']QUOTE(jeremywesselman @ May 22 2006, 10:55 AM) [snapback]375986[/snapback][/div][div class=\'quotemain\'][!--quotec--]
If you are familiar with ASP, you should be able to easily conver this code to php. Just a slight chage of syntax.

[code]
<?php
}
else
{
     [color=#CC0000]include('../includes/incl_logout.php')[/color];
}
?>[/code]

[/quote]

Jeremy,
how can I insert a table in the red coded space. When I try to just insert a table there, I get errors of missing objects.

Regards,
Deon
Link to comment
https://forums.phpfreaks.com/topic/10167-sessions-show-if/#findComment-37931
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.