# Php url

**URL:** <https://forum.kirupa.com/t/php-url/29982>\
**Category:** Uncategorized\
**Created:** [September 2, 2003, 4:59pm UTC](https://forum.kirupa.com/t/php-url/29982 "2003-09-02T16:59:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jazzman121](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jazzman121/32/127_2.png) [@jazzman121](https://forum.kirupa.com/u/jazzman121)\
**Post date:** [September 2, 2003, 4:59pm UTC](https://forum.kirupa.com/t/php-url/29982/1 "2003-09-02T16:59:12Z")

</div>

in php… when i specify

```php
move_uploaded_file($userfile[0], "/ft_files/1.jpg"

```

does php take that url respective to the folder where the php file is or does it take the url respective to the root of the server that is

/var/www/html/ or whaterver the url is ??

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 5:42pm UTC](https://forum.kirupa.com/t/php-url/29982/2 "2003-09-02T17:42:46Z")

</div>

It takes the URL depending on the folder where the php file is…

(I’m pretty sure)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 3, 2003, 4:40am UTC](https://forum.kirupa.com/t/php-url/29982/3 "2003-09-03T04:40:00Z")

</div>

exactly, whenever using relative paths, they are always RELATIVE to the file that contains the URL. For example, if your \*.php file is “[http://www.host.com/subdir/file.php](http://www.host.com/subdir/file.php)” , and you linked like in this example

```php
<? echo "<a href=otherfile.php>click</a>"; ?>

```

then the URL displayed would be “[http://www.host.com/subdir/otherfile.php](http://www.host.com/subdir/otherfile.php)”.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 4, 2003, 7:30pm UTC](https://forum.kirupa.com/t/php-url/29982/4 "2003-09-04T19:30:44Z")

</div>

i don’t understand why your using that code anyway… you only need to use the copy() function to upload the files…
