Johan,
Use a combination of getcwd() and chdir(). It's well worth while checking
out the functions offered for both directory and file.
<?
$cwd = getcwd();
chdir ($cwd."/wherever/you/want/to/set/it");
> #The following index.htm contains links, see below.
>$link = "data/data.htm";
>$fd = fopen ($link, "r");
>echo fread ($fd,filesize( $link));
>fclose ($fd);
chdir( $cwd );
?>
Cheers - Miles Thompson
At 10:07 PM 5/10/01 +0200, Johan wrote:
>My question: how do you set a path using php or html?
>I need it for the following code:
>
>index.php -----------------------------------------
><?
> #The following index.htm contains links, see below.
> $link = "data/data.htm";
> $fd = fopen ($link, "r");
> echo fread ($fd,filesize( $link));
> fclose ($fd);
>?>
>---------------------------------------------------
>
>
>data.htm ------------------------------------------
><download.htm>Download it now!
>---------------------------------------------------
>
>The PHP includes the data.htm file in the page generated by index.php, but
>the link DOWNLOAD.ZIP won't work because that file is in the DATA directory.
>How can I set the path to DATA - and after reading the file, set the path
>back to the directory where index.php is located?
>I'm running Linux.
>
>Thanks in advance, Johan
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]