Php sets the index. php file to read-only
- Function set_writeable ($ file_name)
- {
- If (@ chmod ($ file_name, 0555 ))
- {
- Echo "the read-only attribute of the index. php file has been modified ";
- }
- Else
- {
- Echo "an error occurred while modifying the read-only attribute of the index. php file. the space provider does not support this operation! ";
- }
- }
- Set_writeable ("index. php ");
- ?>
-
Save the preceding content as setread. php and then upload it to the space. you can directly view the address in the browser to set read-only. However, after setting this read-only attribute, you do not have the permission to delete index. php through ftp. if you need to delete or overwrite index. php, use the following code to set the read and write permissions for index. php. The following code sets index. php to read and write data:
- Function set_writeable ($ file_name)
- {
- If (@ chmod ($ file_name, 0777 ))
- {
- Echo "the index. php file read/write attribute is successfully modified ";
- }
- Else
- {
- Echo "an error occurred while modifying the index. php file read/write attribute. the space provider does not support this operation! ";
- }
- }
- Set_writeable ("index. php ");
- ?>
-
Save the preceding content as setwrite. php. you can set the read and write permissions by accessing the browser. |