how to include file which are located outside of the folderAccess and Display Images/ Prompt File Downloads that are located outside the application folderDude, where's my php.ini? (server config)php Include and path to other filesHow to include a php file into two others which are in different directories ? (not the other way around!).js files not being called on pages included in foldersHow to reference CSS file so it can be found using an include in PHPHow to Access PHP File in Separate Foldersaccess folder outside public-htmlFile pathing on a 'header.php' that is i placed on an include() function on different foldersHow to redirect (header location) to an html file?
Can multiple outlets be directly attached to a single breaker?
Is 12 minutes connection in Bristol Temple Meads long enough?
Are there any sonatas with only two sections?
Smooth function that vanishes only on unit cube
What is this minifig/minidoll (?)
How to make a not so good looking person more appealing?
Do Grothendieck universes matter for an algebraic geometer?
Fixed width with p doesn't work
Why are BJTs common in output stages of power amplifiers?
How to redirect stdout to a file, and stdout+stderr to another one?
Was the dragon prowess intentionally downplayed in S08E04?
How might a landlocked lake become a complete ecosystem?
Extract the characters before last colon
"The van's really booking"
Can a tourist shoot a gun for recreational purpose in the USA?
Why do the lights go out when someone enters the dining room on this ship?
Is it wrong to omit object pronouns in these sentences?
Why doesn't Iron Man's action affect this person in Endgame?
Were any of the books mentioned in this scene from the movie Hackers real?
Holding rent money for my friend which amounts to over $10k?
Why did the metro bus stop at each railway crossing, despite no warning indicating a train was coming?
Can you pick an advanced rogue talent with the Extra Rogue Talent feat?
Is there any way to adjust the damage type of the Eldritch Blast cantrip so that it does fire damage?
Can my Serbian girlfriend apply for a UK Standard Visitor visa and stay for the whole 6 months?
how to include file which are located outside of the folder
Access and Display Images/ Prompt File Downloads that are located outside the application folderDude, where's my php.ini? (server config)php Include and path to other filesHow to include a php file into two others which are in different directories ? (not the other way around!).js files not being called on pages included in foldersHow to reference CSS file so it can be found using an include in PHPHow to Access PHP File in Separate Foldersaccess folder outside public-htmlFile pathing on a 'header.php' that is i placed on an include() function on different foldersHow to redirect (header location) to an html file?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have create my system of three folders
- pages folder
- style folder
- images folder
and one index.php file.
My problem is how I can include index.php file in my file login.php which are found in pages folder.
I'm trying to header ("Location:index.php") don't work.
Not: this index.php is single file located outside of those folders
<?php
header ("Location:index.php");
?>
php
add a comment |
I have create my system of three folders
- pages folder
- style folder
- images folder
and one index.php file.
My problem is how I can include index.php file in my file login.php which are found in pages folder.
I'm trying to header ("Location:index.php") don't work.
Not: this index.php is single file located outside of those folders
<?php
header ("Location:index.php");
?>
php
Use <?php header ("Location: ../index.php"); ?>
– PHP Web
Mar 23 at 15:12
add a comment |
I have create my system of three folders
- pages folder
- style folder
- images folder
and one index.php file.
My problem is how I can include index.php file in my file login.php which are found in pages folder.
I'm trying to header ("Location:index.php") don't work.
Not: this index.php is single file located outside of those folders
<?php
header ("Location:index.php");
?>
php
I have create my system of three folders
- pages folder
- style folder
- images folder
and one index.php file.
My problem is how I can include index.php file in my file login.php which are found in pages folder.
I'm trying to header ("Location:index.php") don't work.
Not: this index.php is single file located outside of those folders
<?php
header ("Location:index.php");
?>
php
php
edited Mar 23 at 16:36
dearsina
1,8471321
1,8471321
asked Mar 23 at 14:18
simkokosimkoko
24
24
Use <?php header ("Location: ../index.php"); ?>
– PHP Web
Mar 23 at 15:12
add a comment |
Use <?php header ("Location: ../index.php"); ?>
– PHP Web
Mar 23 at 15:12
Use <?php header ("Location: ../index.php"); ?>
– PHP Web
Mar 23 at 15:12
Use <?php header ("Location: ../index.php"); ?>
– PHP Web
Mar 23 at 15:12
add a comment |
2 Answers
2
active
oldest
votes
Just make the URL's relative from the document root (by adding an initial /
):
header('Location: /index.php');
or if you want to redirect to a sub folder:
header('Location: /theFolder/index.php');
Then you don't need to care what folder you're in and add a bunch of ../../
.
add a comment |
When traversing a folder tree, you can use ../
to denote a parent folder.
.
is a shortcut to 'the current folder'...
is a shortcut to 'the folder containing the current folder'.
Assuming the index.php
file is in the parent folder of the login.php
page, you can access it like so:
header ("Location: '../index.php'");
What are the purpose of putting ../ at the starting?
– simkoko
Mar 23 at 14:23
Have a read of the description.
– dearsina
Mar 23 at 14:25
yes it work ! but I'm got confussion on what are the aim of putting ../ at the starting? and it's only two fullstop (..) not otherwise when you put one don't work three don't work.why?
– simkoko
Mar 23 at 14:30
../
means "go one folder up". You can chain them,../../
means go two folders up.
– dearsina
Mar 23 at 14:36
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314649%2fhow-to-include-file-which-are-located-outside-of-the-folder%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Just make the URL's relative from the document root (by adding an initial /
):
header('Location: /index.php');
or if you want to redirect to a sub folder:
header('Location: /theFolder/index.php');
Then you don't need to care what folder you're in and add a bunch of ../../
.
add a comment |
Just make the URL's relative from the document root (by adding an initial /
):
header('Location: /index.php');
or if you want to redirect to a sub folder:
header('Location: /theFolder/index.php');
Then you don't need to care what folder you're in and add a bunch of ../../
.
add a comment |
Just make the URL's relative from the document root (by adding an initial /
):
header('Location: /index.php');
or if you want to redirect to a sub folder:
header('Location: /theFolder/index.php');
Then you don't need to care what folder you're in and add a bunch of ../../
.
Just make the URL's relative from the document root (by adding an initial /
):
header('Location: /index.php');
or if you want to redirect to a sub folder:
header('Location: /theFolder/index.php');
Then you don't need to care what folder you're in and add a bunch of ../../
.
answered Mar 23 at 14:52
Magnus ErikssonMagnus Eriksson
8,16141428
8,16141428
add a comment |
add a comment |
When traversing a folder tree, you can use ../
to denote a parent folder.
.
is a shortcut to 'the current folder'...
is a shortcut to 'the folder containing the current folder'.
Assuming the index.php
file is in the parent folder of the login.php
page, you can access it like so:
header ("Location: '../index.php'");
What are the purpose of putting ../ at the starting?
– simkoko
Mar 23 at 14:23
Have a read of the description.
– dearsina
Mar 23 at 14:25
yes it work ! but I'm got confussion on what are the aim of putting ../ at the starting? and it's only two fullstop (..) not otherwise when you put one don't work three don't work.why?
– simkoko
Mar 23 at 14:30
../
means "go one folder up". You can chain them,../../
means go two folders up.
– dearsina
Mar 23 at 14:36
add a comment |
When traversing a folder tree, you can use ../
to denote a parent folder.
.
is a shortcut to 'the current folder'...
is a shortcut to 'the folder containing the current folder'.
Assuming the index.php
file is in the parent folder of the login.php
page, you can access it like so:
header ("Location: '../index.php'");
What are the purpose of putting ../ at the starting?
– simkoko
Mar 23 at 14:23
Have a read of the description.
– dearsina
Mar 23 at 14:25
yes it work ! but I'm got confussion on what are the aim of putting ../ at the starting? and it's only two fullstop (..) not otherwise when you put one don't work three don't work.why?
– simkoko
Mar 23 at 14:30
../
means "go one folder up". You can chain them,../../
means go two folders up.
– dearsina
Mar 23 at 14:36
add a comment |
When traversing a folder tree, you can use ../
to denote a parent folder.
.
is a shortcut to 'the current folder'...
is a shortcut to 'the folder containing the current folder'.
Assuming the index.php
file is in the parent folder of the login.php
page, you can access it like so:
header ("Location: '../index.php'");
When traversing a folder tree, you can use ../
to denote a parent folder.
.
is a shortcut to 'the current folder'...
is a shortcut to 'the folder containing the current folder'.
Assuming the index.php
file is in the parent folder of the login.php
page, you can access it like so:
header ("Location: '../index.php'");
edited Mar 23 at 14:39
answered Mar 23 at 14:21
dearsinadearsina
1,8471321
1,8471321
What are the purpose of putting ../ at the starting?
– simkoko
Mar 23 at 14:23
Have a read of the description.
– dearsina
Mar 23 at 14:25
yes it work ! but I'm got confussion on what are the aim of putting ../ at the starting? and it's only two fullstop (..) not otherwise when you put one don't work three don't work.why?
– simkoko
Mar 23 at 14:30
../
means "go one folder up". You can chain them,../../
means go two folders up.
– dearsina
Mar 23 at 14:36
add a comment |
What are the purpose of putting ../ at the starting?
– simkoko
Mar 23 at 14:23
Have a read of the description.
– dearsina
Mar 23 at 14:25
yes it work ! but I'm got confussion on what are the aim of putting ../ at the starting? and it's only two fullstop (..) not otherwise when you put one don't work three don't work.why?
– simkoko
Mar 23 at 14:30
../
means "go one folder up". You can chain them,../../
means go two folders up.
– dearsina
Mar 23 at 14:36
What are the purpose of putting ../ at the starting?
– simkoko
Mar 23 at 14:23
What are the purpose of putting ../ at the starting?
– simkoko
Mar 23 at 14:23
Have a read of the description.
– dearsina
Mar 23 at 14:25
Have a read of the description.
– dearsina
Mar 23 at 14:25
yes it work ! but I'm got confussion on what are the aim of putting ../ at the starting? and it's only two fullstop (..) not otherwise when you put one don't work three don't work.why?
– simkoko
Mar 23 at 14:30
yes it work ! but I'm got confussion on what are the aim of putting ../ at the starting? and it's only two fullstop (..) not otherwise when you put one don't work three don't work.why?
– simkoko
Mar 23 at 14:30
../
means "go one folder up". You can chain them, ../../
means go two folders up.– dearsina
Mar 23 at 14:36
../
means "go one folder up". You can chain them, ../../
means go two folders up.– dearsina
Mar 23 at 14:36
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314649%2fhow-to-include-file-which-are-located-outside-of-the-folder%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Use <?php header ("Location: ../index.php"); ?>
– PHP Web
Mar 23 at 15:12