我被要求查看其他人创建的网站上的联系表单,该表单显然已停止工作。它是一个PHP表单,我找到了一个TPL文件。经过一番研究,我发现一个TPL文件是由Smarty Template Engine创建的。我根本不熟悉这个。我作为用户测试了表单,在前端,它似乎提交没有错误。但是,网站所有者没有收到表单中的电子邮件。
我在服务器上的文件中查了一下,无法找到电子邮件收件人的定义位置。所以,我想先问一下......电子邮件收件人定义在哪里?
谢谢。
编辑(添加contact.php):
<?php
ob_start();
define ("INCLUDE_PATH", "./");
require_once INCLUDE_PATH."lib/inc.php";
Content(); //////////// For page content
if($_REQUEST['mode'] == "contact"){
if(checkData()) {
send_data();
}
else
{
dispmiddle();
}
}
else
{
dispmiddle();
}
ob_end_flush();
function dispmiddle(){
require_once INCLUDE_PATH."lib/common.php";
// for service
$_SESSION['checkCode'] = makeRandomWord(5);
$smarty->assign('textname',isset($_REQUEST['textname']) ? prepareRequest($_REQUEST['textname'],1) : prepareRequest($_REQUEST['textname'],1));
$smarty->assign('textemail',isset($_REQUEST['textemail']) ? prepareRequest($_REQUEST['textemail'],1) : prepareRequest($_REQUEST['textemail'],1));
$smarty->assign('textcontactno',isset($_REQUEST['textcontactno']) ? prepareRequest($_REQUEST['textcontactno'],1) : prepareRequest($_REQUEST['textcontactno'],1));
$smarty->assign('textcomment1',isset($_REQUEST['textcomment1']) ? prepareRequest($_REQUEST['textcomment1'],1) : prepareRequest($_REQUEST['textcomment1'],1));
$smarty->assign('textcompany',isset($_REQUEST['textcompany']) ? prepareRequest($_REQUEST['textcompany'],1) : prepareRequest($_REQUEST['textcompany'],1));
foreach($GLOBALS as $key=>$val){
if(strstr($key, "_err")){
$smarty->assign($key, $val);
}
}
$smarty->display("contactus.tpl");
}
function checkData() {
//include("securimage.php");
$errCounter=0;
if(trim($_POST['textname'] == ""))
{
$errCounter++;
$GLOBALS['textname_err'] = "Please Enter Your Name";
}
if(trim($_POST['textcontactno'] == ""))
{
$errCounter++;
$GLOBALS['textcontactno_err'] = "Please Enter Phone";
}
if($errCounter>0){
return false;
}
else{
return true;
}
}
function send_data(){
require_once INCLUDE_PATH."lib/common.php";
$obj = new Contact();
$obj->name = $_REQUEST['textname'];
$obj->email = $_REQUEST['textemail'];
$obj->phone = $_REQUEST['textcontactno'];
$obj->company = $_REQUEST['textcompany'];
$obj->enquiry = $_REQUEST['textcomment1'];
$obj->contacttype = "General";
$chk = $obj->addContact();
if($chk == true)
{
$msg = "Thank you for contacting us.";
$smarty->assign('msg', $msg);
}
else
{
$msg = "There is some problem. Please try again.";
$smarty->assign('msg', $msg);
}
$smarty->display("contactus.tpl");
}
?>