如何.php
在文件夹外呼叫
我的文件夹构造器是
我在cart.php
我的代码是
$tpl_file ='../mail.php';//problem is here LINE 279
$msg_tmpl = file_get_contents($tpl_file);
if (!file_exists($tpl_file))
{
?>
<script>
alert('no');
</script>
<?php
}
else
{
?>
<script>
alert('yes');
</script>
<?php
}
所以我的问题是我想从中获取所有数据mail.php
并进行分配$tpl_file
。
在上面尝试我越来越总是NO与
遇到PHP错误
严重程度:警告
消息:file_get_contents(../ mail.php):打开流失败:没有这样的文件或目录
文件名:pages / cart.php
行号:279
有任何想法吗??
改变
$tpl_file ='../mail.php';
到
$tpl_file ='application/views/pages/mail.php';
注意:从您的屏幕快照中,mail.php
位于application/views/pages/mail.php
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句