# Httpath php

**URL:** <https://forum.kirupa.com/t/httpath-php/186559>\
**Category:** Uncategorized\
**Created:** [April 22, 2006, 10:37am UTC](https://forum.kirupa.com/t/httpath-php/186559 "2006-04-22T10:37:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdl](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jdl](https://forum.kirupa.com/u/jdl)\
**Post date:** [April 22, 2006, 10:37am UTC](https://forum.kirupa.com/t/httpath-php/186559/1 "2006-04-22T10:37:57Z")

</div>

Hi,

$httppath = “http:www.mydomain.net/dir/”.$\_SERVER[‘HTTP\_HOST’].dirname($\_SERVER[‘PHP\_SELF’]);

I’m not getting the path right because when the file is uploaded the URL  
ends up being "http:www.mydomain.net/dir/file.jpghttp:www.mydomain.net/dir/file.jpg

Any help with this little error appreciated.

---

<div class="post-metadata">

**Author:** ![Sniper\_Jo](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@Sniper\_Jo](https://forum.kirupa.com/u/Sniper_Jo)\
**Post date:** [April 22, 2006, 2:21pm UTC](https://forum.kirupa.com/t/httpath-php/186559/2 "2006-04-22T14:21:14Z")

</div>

what are you trying todo? $\_SERVER[‘HTTP\_HOST’] is the address eg [mydomain.net](http://mydomain.net) and $\_SERVER[‘PHP\_SELF’] is the location of the file from the root. so if you just want the address of that file its

$httppath = $\_SERVER[‘HTTP\_HOST’].’/’.$\_SERVER[‘PHP\_SELF’]

---

<div class="post-metadata">

**Author:** ![jdl](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jdl](https://forum.kirupa.com/u/jdl)\
**Post date:** [April 23, 2006, 12:27am UTC](https://forum.kirupa.com/t/httpath-php/186559/3 "2006-04-23T00:27:23Z")

</div>

> [@Sniper Jo](#):
>
> what are you trying todo? $\_SERVER[‘HTTP\_HOST’] is the address eg [mydomain.net](http://mydomain.net) and $\_SERVER[‘PHP\_SELF’] is the location of the file from the root. so if you just want the address of that file its
> 
> $httppath = $\_SERVER[‘HTTP\_HOST’].‘/’.$\_SERVER[‘PHP\_SELF’]

THANKS, that’s fixed it.
