How can I redirect a user like this

As you can see in this image there is a profile icon, now what I want is

when a user is not Signed In and when he/she clicks on the icon he should redirect to the signup page

and when

he/she is logged in I want to show their profile image.

How I can do this in php?

Something like

if($_SESSION['logged'] == true) { $url = "profile"; }
else { $url = "signup"; }

In the html

<a href="<?php echo $url;?>"><img></a>
1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.