I have the following code and wanted to put the <font> </font>
tag for example to format the user.
<?php
session_start();
echo "Usuario: ". $_SESSION['usuarioNome'];
?>
I have the following code and wanted to put the <font> </font>
tag for example to format the user.
<?php
session_start();
echo "Usuario: ". $_SESSION['usuarioNome'];
?>
Add the HTML to this string, so for example:
<?php
session_start();
echo "<strong>Usuario:</strong> ". $_SESSION['usuarioNome'];
?>
This will appear in the browser like this:
User: Lauriana
Closes the php tag, writes the html normally, and calls the variable with an echo $ nameVar. In the case, I created a p, and inside it I added a span to customize what is needed from css.Cor, font, margin and etc.
<?php
session_start();
// atribuí uma variável ao teu _SESSION.
// Não precisava, só quis reduzir o código de chamada.
$username = $_SESSION['usuarioNome'];
?>
<p>
Olá,
<span class="user-name">
<?php
// Escreve a variável
echo $username;
?>
</span>
</p>
In your css file you add the class added to span.
<style>
.user-name{ font-weight: bold; }
</style>
It will display like this:
Hello, Hugo