0

下面的代码连接到一个联系表格。提交时,您会收到两条消息之一。如何向这些消息添加 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-->

谢谢!

4

2 回答 2

2

改变你的$message变量。例如:

$message = "<h1>Message received!</h1> Thank you for contacting us.";
于 2012-09-19T18:29:27.753 回答
0

这两种方法中的任何一种都可以:

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

或者

<h1><?php echo $message?><h1>
于 2012-09-19T18:30:43.810 回答