PHP的联系表格主题栏

问题描述:

我有这对我的contact.php文件:PHP的联系表格主题栏

'.JText::_('PLG_LABEL_NAME').' 
     <input type="text" name="name" id="name" value="'.$_POST['name'].'" /> 
     <br /> 
     <br /> 
     '.JText::_('PLG_LABEL_EMAIL').' 
     <input type="text" name="email" id="email" value="'.$_POST['email'].'" /> 
     <br /> 
     <br /> 
     '.JText::_('PLG_LABEL_SUBJECT').' 
     <input type="text" name="subject" id="subject" value="'.$_POST['subject'].'" /> 
     <br /> 
     <br /> 

这两个或其中添加我这些代码?

<?php if($this->item->params->get('itemTitle')): ?> 
<?php echo $this->item->title; ?> 

在此先感谢您。


它不在范围文件中。包含该项目的文件是在item.php中,它有这条线来获取项目标题并将其显示为

<?php if($this->item->params->get('itemTitle')): ?> 
     <!-- Item title --> 
     <h2 class="itemTitle"> 
     <?php echo $this->item->title; ?> 

喜欢这个?

$html .= '<label for="contact_subject">'; 
$html .= '&nbsp;'. JText::_('Subject').':'; 
if ($this->item->params->get('itemTitle')) $html .= $this->item->title; 
$html .= '</label>'; 
+0

哦对不起,我发布了错误的HTML语法我有这个在我的contactform.php 如果(!$ _ POST [ “主题”]){$误差1 = JText :: _( 'PLG_ERROR_NO_SUBJECT') “
”;} and '.JText :: _('PLG_LABEL_SUBJECT')。' \t \t \t \t
jmc

+0

对不起,我不太跟随,你可以用正确的代码段中的相关代码编辑问题吗? – DaveRandom

+0

我编辑了我的第一篇文章。再次感谢。 – jmc