+ 1
How to include an external html file in a php file.
My Project files are like , index.html Assets(Folder) Php(Folder)(This folder is under Assets folder) Under php Folder i have a php file in that i want to include the index.html I have tried the include method in php but it doesn't work. it shows errors like , failed to open stream: No such file or directory in C:\xampp\htdocs\out_pass. I also tried the ../ method to access the parent directory that is also not working
3 Respostas
+ 3
"No such file directory" means the url to the file is incorrect. This can be tricky when you don't know the root directory of where your site is being served. Try placing the file at the first level of where the php file is then
include ("file.html")
You can also use readfile
readfile("file.html")
+ 2
I think you should try this path:
. /Assets/Php/index.html
+ 2
Thank you both of you Runtime Terror Quantum it's working perfectly 💥