我编写了一个以红色显示错误的 php 代码。但不知何故,这似乎行不通。这是我的代码:
<?php
...
if(!$name || !$email || !$contact || !$itemid){
//if not display an error message
echo "<span style="color: red;" /><center>Fields marked with <strong>( * ƥ</strong> are mandatory!</center></span>";
}else{...
?>