Jump to content


Photo

Sessions: Show if ...


  • Please log in to reply
3 replies to this topic

#1 Deon

Deon
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 22 May 2006 - 07:35 AM

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


#2 jeremywesselman

jeremywesselman
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts
  • LocationIndependence, KY

Posted 22 May 2006 - 08:55 AM

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

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

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--]

#3 Deon

Deon
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 22 May 2006 - 09:01 AM

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


#4 Deon

Deon
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 22 May 2006 - 12:52 PM

[!--quoteo(post=375986:date=May 22 2006, 10:55 AM:name=jeremywesselman)--][div class=\'quotetop\']QUOTE(jeremywesselman @ May 22 2006, 10:55 AM) View Post[/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.

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

[/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) View Post[/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.

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

[/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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users