3
I have the following code and I wanted to tag <font> </font>
for example to format the user.
<?php
session_start();
echo "Usuario: ". $_SESSION['usuarioNome'];
?>
3
I have the following code and I wanted to tag <font> </font>
for example to format the user.
<?php
session_start();
echo "Usuario: ". $_SESSION['usuarioNome'];
?>
3
Joins HTML to this string, for example:
<?php
session_start();
echo "<strong>Usuario:</strong> ". $_SESSION['usuarioNome'];
?>
It will appear in the browser like this:
User: Lauriana
1
Close the php tag, write html normally, and call the variable with an echo $Var name. In this case, I created a p, and within it I added a span to customize whatever css is needed.Color, font, margin, 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>
He’ll show off like this:
Hello, Hugo
Browser other questions tagged php echo
You are not signed in. Login or sign up in order to post.
Try to put a brief explanation of what you did and how it works.
– Francisco
Ready @Francisco, documented.
– Hugo Medeiros