Php How To Include File In Windows
- Forums
- PHP
- Php How To Include File In Windows
If You Are Having Problems Including A Php File In Windows Because Of The Slashes Are Backwards This Post Will Help You Find How To Fix And Get Around This Obsticle [2088], Last Updated: Mon Jun 24, 2024
Webune Support
Sun Jan 17, 2010
0 Comments
337 Visits
Welcome to Webune Support Forums
Are you tired of you current web hosting provider? not giving you enough service or support. Switch today to Webune. We are programmers like you who understand what type of questions PHP developers ask. Just like you!
Today we are going to cover a question for beginners. When you start to write PHP scripts you will start to use the include() or include_once() functions to include in your php scripts.
so lets say i am using a development server on a windows computer installed with Apache and PHP - so when you start to write your script you cannot use the backslashes.
for example, lets say i want to include this file in my PHP script:
include('C:\inetpub\wwwroot\includes\myfunctions.php');
but its not working because when you use the \ (backslash) it escapes the path. so what is the solution?
the answer to this problem is easy, just switch the \ (backslashes) with the / (forward slashes) so when you include a file do it like this:
include('C:/inetpub/wwwroot/includes/myfunctions.php');
that should work, try it