How to get a PHP file to be included across files in different directories?
-
Currently I have created some php based webpages and uploaded them to my web hosting server.It has a PHP 5.1.6 installed.With this I am able to include files only that are in the ...show more
-
Answer:
Yes thats right you could use a require() method and specify the path of the file to call or else you could use the include method. For example vars.php <?php $color = 'green'; $fruit = 'apple'; ?> test.php <?php echo "A $color $fruit"; // A include 'vars.php'; echo "A $color $fruit"; // A green apple ?>
5HYNS5I5OY2FC7VX63LGE26LTI at Yahoo! Answers Visit the source
Related Q & A:
- How to get the source file of a particular type?Best solution by social.msdn.microsoft.com
- How to use external PHP file in СakePHP 2?Best solution by Stack Overflow
- How to read a PDF file with PHP?Best solution by Stack Overflow
- How do I get a video file off a sony video camera disk?Best solution by Yahoo! Answers
- How to get a license if you move to a different state?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.