Jump to content

Recommended Posts

Hello.

I use XAMPP,

and lets say I have one file here: XAMPP/htdocs/file1.php

and another one here; XAMPP/htdocs/files/file2.php

 

Now for "file1" to go to "file2" i just use this code "files/file2.php"

but if I want to go from "file2" to "file1". Something like:

"Jump backwards/file1.php"

Need answer ASAP

//K

Link to comment
https://forums.phpfreaks.com/topic/193269-directory-help/
Share on other sites

If you put a slash at the very beginning.. you can make an "absolute" path.. (not exactly absolute)

 

for instance..

if you're link path points to "/htdocs/file1.php"... then that link will work ANYWHERE on that server, because it's explicitly put.

 

on the other hand.. if you don't push a slash in the beginning.  It will look for a folder named htdocs in the current directory the file is in.

 

 

I'm not sure if this method will work on Windows or not though.. haven't tried.

Link to comment
https://forums.phpfreaks.com/topic/193269-directory-help/#findComment-1017704
Share on other sites

If you put a slash at the very beginning.. you can make an "absolute" path.. (not exactly absolute)

 

for instance..

if you're link path points to "/htdocs/file1.php"... then that link will work ANYWHERE on that server, because it's explicitly put.

 

on the other hand.. if you don't push a slash in the beginning.  It will look for a folder named htdocs in the current directory the file is in.

 

 

I'm not sure if this method will work on Windows or not though.. haven't tried.

 

What if I upload it on a web host. I cant write: C:/Xampp... there.

Whats the code then?

Link to comment
https://forums.phpfreaks.com/topic/193269-directory-help/#findComment-1017995
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.