Jump to content

[SOLVED] linking in an if statment


squiblo

Recommended Posts

this is my effort, but its not working, what is the proper way to do this?

 

<?php
if($_SESSION['mycompany'])
{
echo "Welcome " . ucwords(strtolower($_SESSION['mycompany']));
?>

<a href="/login.php" style="text-decoration:none"><font color=#FFFF00>
<?php
}
else
{
echo "Sign in </a></font>/ Register";
}
?>  

 

I only want "Sign In" to be linked

Link to comment
https://forums.phpfreaks.com/topic/170473-solved-linking-in-an-if-statment/
Share on other sites

What exactly is the purpose of starting the anchor tag in a different condition?

 

I would think this is what you'd want..

 

<?php
if($_SESSION['mycompany'])
{
echo "Welcome " . ucwords(strtolower($_SESSION['mycompany']));
}
else
{
echo "<a href='login.php' style='text-decoration:none'>Sign in </a>/ Register";
}
?> 

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.