I have the following code that is not working.
echo "<a href='memberarea.html'><span class="glyphicon glyphicon-lock"></span> Member area</a>";
I think I'm not doing well to incorporate HTML into PHP.
I have the following code that is not working.
echo "<a href='memberarea.html'><span class="glyphicon glyphicon-lock"></span> Member area</a>";
I think I'm not doing well to incorporate HTML into PHP.
You need to escape the quotation marks or replace them with single quotation marks, since you are using quotation marks for echo.
Escaping the quotes:
echo "<a href='memberarea.html'><span class=\"glyphicon glyphicon-lock\"></span> Member area</a>";
Or:
echo "<a href='memberarea.html'><span class='glyphicon glyphicon-lock'></span> Member area</a>";
If you use double quotation marks to define the string, you must use single quotes in the middle or escape:
echo "algo \"algo dentro de aspas\" algo";
or
echo "algo 'algo dentro de aspas' algo";
In your case it could be:
echo "<a href='memberarea.html'><span class='glyphicon glyphicon-lock'></span> Member area</a>";
Actually, the code presented does not need to be written in php, it can be written in html itself:
<a href='memberarea.html'><span class="glyphicon glyphicon-lock"></span> Member area</a>
But if you want to put php, you should use a .php file to make use of:
-- script html aqui
<?php
-- codigo php aqui
?>
-- continuação do script html