简体   繁体   中英

What is wrong with this attempt using php to include functions.php and header.php file?

What, if anything, is wrong with this code? I'm a beginner. I'm trying to include a header file but when I test and try to load it says it's not working.

<?php include("http://test.orwallo.com/widget_corp/includes/header.php"); ?>

I can't tell for your HTTP 500 error. But you are clearly using include() wrong.

The include or require_once statement is used to load local php files. You should not have a reason to include URLs. Rewrite it to:

<?php
   require_once("./includes/functions.php");
   include("./includes/header.php");
?>

Adapt the path.

我试图打开此文件,但似乎不存在

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM