PHP Include not working - Hostgator


PHP Include not working - Hostgator

我的服务器上安装了一个预订脚本,上面说要在你的网站中包含小日历,以便使用php-include。

我的代码是

<div class="calendarcontainer">
<?php include (http://www.jetnightclub.com/booking/calendar.php); ?>
</div>

什么也没发生。当我直接转到页面时,它就在那里,所以服务器正在读取php。。。不知道为什么它不会弹出。

警告:链接是NSFW,它是一个夜总会的网站。如果这是一个问题,请不要打开它。

您忘记了此处的引号。参考PHP手册

这是解决方案:

        <div class="calendarcontainer">
        <?php include ("http://www.jetnightclub.com/booking/calendar.php"); ?>
        </div>

更改托管服务器上的php.ini文件。

allow_url_include=On

然后重新启动web服务器。然后你可以使用这样的代码:

<div class="calendarcontainer">
    <?php include ("http://www.jetnightclub.com/booking/calendar.php"); ?>
</div>