将span / h1样式添加到php

时间:2012-09-19 18:26:25

标签: php html css

以下代码连接到联系表单。在提交时,您会收到两条消息之一。如何为这些消息添加span和h1样式?

 <?php

    if($_GET['message'] == "thanks")  {  
        $message = "Message received! Thank you for contacting us.";
        } else {
        if($_GET['message'] == "wrongcaptcha")
        $message = "We are having problems processing your message. The captcha code you entered was incorrect.";
        }

?>


<div id="thankyoubox">
<p><?php echo $message?><p>

</div><!--end of thankyoubox-->

谢谢!

2 个答案:

答案 0 :(得分:2)

更改您的$message变量。例如:

$message = "<h1>Message received!</h1> Thank you for contacting us.";

答案 1 :(得分:0)

这两种方式中的任何一种都可行:

$message = '<h1 style="color:#333;font-weight:bold;" >Message received! <span>Thank you</span> for contacting us.</h1>';

<h1><?php echo $message?><h1>