Reputation: 1501
I have quick question about a herf link in php field. When I try to make a href link in php field by using echo or print, it does not work the link. Could you see the code briefly? Thanks!
if(isset($_SESSION["manager"])){
echo "<div id=\"login_link\">
Welcome Admin!<br>
<a herf=\"storeAdmin/admin_logout.php\">Log out</a>
</div>";
}
Upvotes: 0
Views: 17410
Reputation: 1369
Had the same problem but its because I was using
echo "".htmlspecialchars($errorMessage)."";
removing the htmlspecialchars fixed it for me.
Upvotes: 0
Reputation: 698
also just a suggestion, you can always use ' inside of " instead of having to cancel your quotes. Atleast it works for me
Upvotes: 1
Reputation: 6013
href=""
not herf=""
href="/root-path-to-your-stuff/storeAdmin/admin_logout.php"
Upvotes: 1
Reputation: 3280
Here I have updated your code
if(isset($_SESSION["manager"])){
echo '<div id=\"login_link\">
Welcome Admin!<br>
<a href=\"storeAdmin/admin_logout.php\">Log out</a>
</div>';
}
Upvotes: 1
Reputation: 2822
It should be href="...." not "herf".
For more info about the a tag you can take a look here: http://www.w3schools.com/tags/tag_a.asp
Upvotes: 8