Sublime Forum

Problem with html code in php tags

#1

Hello. i am a french man.
my problem is that i can’t write html in php tags.
it does not go through.
the syntax highlighting disappears as soon as I start writing html in the <? php tags

?>

my page extensions are in .php
I need your help.

0 Likes

#2

some body can help me please?
coloration syntaxique ne marche pas et le code ne s’execute pas merci.

syntax highlighting does not work and the code does not execute thanks.

0 Likes

#3

Anything in <?php ... ?> are PHP codes. Others are HTML (typically).

0 Likes

#4

oui je sais, mais au moins on peut écrire du html dans les balises php?

et la ça ne marche pas?

yes i know, but at least we can write html in php tags?

and it doesn’t work?

0 Likes

#5

no. we can’t. it’s just not how PHP works.

0 Likes

#6

mais pour moi ça ne marche pas.
j’ai essayer de reinstaller toujous la meme chose.
il y a un moyen de remedier a cela?

but for me it doesn’t work.
I always try to reinstall the same thing.
is there a way to fix this?

0 Likes

#7

You are missing the closing and reopening php tags…
your code should be like:

<?php
    // if condition
    if ($condition == 'verified') {
        // close php block
?>
    <div>
        <p>whatever html content</p>
    </div>
<?php
    // reopen php block to end the if statement
    }

image

…hope this helps :wink:

0 Likes