Setting paths in PHP

From: Date: Thu, 10 May 2001 20:07:26 +0000
Subject: Setting paths in PHP
Groups: php.general 
Request: Send a blank email to php-general+get-52341@lists.php.net to get a copy of this message
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 ------------------------------------------ <HTML> <BODY> <A HREF="download.zip">Download it now!</A> </BODY> </HTML> --------------------------------------------------- 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

« previous php.general (#52341) next »