Jump to content

[SOLVED] if statement


squiblo

Recommended Posts

ok i have this working code...

<?php
if($_SESSION['myusername']){
?>

yes

<?php
}
else
{
?>
no
<?php
}
?>

 

 

and i am trying to change it slightly but nothing is working for me  :facewall: this is what i have..

<?php
if($_SESSION['myusername'])
{
echo ucwords(strtolower($_SESSION['myusername']));
}
else
{
echo "Sign in   /   Register";
}
?>

 

the problem there is, it always echos "Sign in   /   Register" if when i log in and when i am not logged in  :shrug:

Link to comment
https://forums.phpfreaks.com/topic/170462-solved-if-statement/
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.