79642580

Date: 2025-05-28 15:50:35
Score: 2
Natty:
Report link

All credit for the answer goes to @KIKO Software and @Phil .

To answer everyones question first: The error is that there is no style added to the class, so the div doesn't revieve a cc style class. My bad that I didn't expres this specificly.

The answer, by @KIKO Software and @Phil, is the quotes and the php tag. I did not add the short_open_tag, so <? didn't work, it should have been <?php And I quotes, I added the quotes because the class should be between quotes "". And to skip a quote during the echo I used the ". But echo itself was sufficient, and the extra quotes just got in the way.

$style = "input_container";

~

<div class=<?php echo $style; ?>>

And special thank you @Jason Lommelen for the htmlspecialchars() tip! I can definatly use that at some places.

Reasons:
  • Blacklisted phrase (0.5): thank you
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @KIKO
  • User mentioned (0): @Phil
  • User mentioned (0): @KIKO
  • User mentioned (0): @Phil
  • User mentioned (0): @Jason
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Desert Wind