Forum Moderators: coopster

Message Too Old, No Replies

get server path

         

adammc

1:40 am on May 4, 2007 (gmt 0)

10+ Year Member



Hi Guys,

Is there a function to get the current serverpath to the directory of the php file thats in use?

Im creating a setup script and have a form / input box that asks for the path and url to the script files.

I was hoping to autofill it (value="")

<tr>
<td width="133">Script Path</td>
<td width="148"><input type="text" name="script-path" size="20" value=""></td>
</tr>

<tr>
<td width="133">Script Url</td>
<td width="148"><input type="text" name="script-path" size="20" value=""></td>
</tr>

Any advice would be greatly appreciated :)

adammc

2:56 am on May 4, 2007 (gmt 0)

10+ Year Member



I used <?php echo dirname(__FILE__);?> to get the dir path.

Is there a function that will give me the current domain name?

adammc

3:23 am on May 4, 2007 (gmt 0)

10+ Year Member



All sorted :)

<?php echo $_SERVER['HTTP_HOST'];?>