Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP snippet not working

Tags:

php

I'm really new to php and am having trouble debugging the following snippet.

<?php
$hintMaintain = <<< EOT
    <hr />
    <div id="user_hint"> ABC DE <span class="status_strtolower($account['status_value'])">ucfirst($account['status_value'])</span>FGH</div>

    <div style="margin: 0px 74px 0px 74px; text-align: center; height: 66px; width:66px; background: url('img/strtolower($maintain)hint.png') no-repeat;">
        <span style="line-height: 66px; font-size: 36px; color: black;">$countdown</span>
    </div>
EOT;

eval("\$hintMaintain = \"$hintMaintain\";");
?>
<!-- SOME HTML -->

<?php echo $hintMaintain; ?>

This shows a server error. I haven't been able to work this out.

Help? Thanks.

like image 612
Navneet Avatar asked May 17 '26 04:05

Navneet


1 Answers

Try:

<?php
$hintMaintain = '<hr />
<div id="user_hint">
    <p> ABC DE 
         <span class="status_'.strtolower($account['status_value']).'">'.ucfirst($account['status_value']).'</span>
    FGH</p>
</div>

<div style="margin: 0px 74px 0px 74px; text-align: center; height: 66px; width:66px; background: url(\'img/'.strtolower($maintain).'hint.png\') no-repeat;">
    <span style="line-height: 66px; font-size: 36px; color: black;">'.$countdown.'</span>
</div>';
?>
<!-- SOME HTML -->
<?php echo $hintMaintain; ?>
like image 194
TheWolfNL Avatar answered May 18 '26 17:05

TheWolfNL