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
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
Share on other sites

Jeremy,

thank you so much for this reply. I REALLY appreciate your reply. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

Regards,
Deon
Link to comment
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
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.