how to pass a variable through the require() or include() function of php?

后端 未结 9 2097
梦如初夏
梦如初夏 2021-02-06 21:34

when I use this:

require(\"diggstyle_code.php?page=$page_no\");

the warning is :failed to open stream: No error in C:\\xampp\\htdocs\\4ajax\\ga

9条回答
  •  别那么骄傲
    2021-02-06 22:21

    require, require_once, include and include_once try to include files from the filesystem in the current file.

    Since there's no files named diggstyle_code.php?page=1, it's totally logical that PHP can't find it.

    You can't pass values that way, however, any variable declared in the current file will be accessible in the included files.

提交回复
热议问题