Page 1 of 1

File access problem

Posted: Thu Dec 18, 2003 1:01 am
by abhram
Hi guys,
I'm creating a folder dynamically and ssaving a php file in that folder. I want that users when provide with the link should be able to access the file as http://mysite/users/<myfolder>

It gives a page not found error, but thru FTP I can actually see the file exists there.

Pls help.

Thnx
Abhra

Posted: Thu Dec 18, 2003 2:22 am
by m3mn0n
Provide some code, and any error messages.

Posted: Thu Dec 18, 2003 2:44 am
by abhram
Here's the code

Code: Select all

function createCustDir($custName,$cid)
	&#123;
		$custDir = $custName;
		chdir('users');
		if(!($dp = mkdir($custDir,0777))) die("Error creating dir");

		if(file_exists($custDir))
		&#123;

                                               <some html content stored in $strPageContent>
			chdir($custDir);
			if(!($fp = fopen("index.php","a"))) die("Error opening dir");
			fwrite($fp,$strPageContent);
			fclose($fp);
		&#125;

	&#125;
Now this is creating the index.php in the designated dir under 'users' dir.
But when accessed thru browser http://mydomain/users/[i]<userdir>[/i] its giving file not found error.

Thnx

Abhra