Page 1 of 1

Ownership - who's that?

Posted: Fri Nov 15, 2002 9:42 am
by Frederick
Im new to PHP so please bare with me, I searched but couldnt find an answer.

I have a simple PHP script that creates a file. The program creates the file with no problem but I noticed that I cant use my edit.php program to make changes and realized that the ownership of the file is '48' and not the domain, what am I doing wrong? Is it that 'W'?

Code: Select all

$fp = fopen("$planfile","w");
                fputs ($fp, "<?php\r\n");
                fputs ($fp, "\$ProfileUsername="$NewUser";\r\n");
		fputs ($fp, "\$ProfileActive="yes";\r\n");
		fputs ($fp, "\$ProfileName="$uName";\r\n");		fputs ($fp, "\$ProfileEmail="$uEmail";\r\n");
		fputs ($fp, "\$ProfileEditPassword="$uPassword";\r\n");               
 fputs ($fp, "?>\r\n");
		fclose ($fp);

Posted: Fri Nov 15, 2002 5:16 pm
by MeOnTheW3
Get a copy of the php manual at php.net.

look up "chown()" and then "chmod()"

48 is the user id of the file owner, to findout that number in php use "fileowner()"

I am on a win32 system and am using the php.chm "windows help" file. Works excellent!