Welcome to the Linux community forum and interact with 2 million technical staff. Recently, many spaces have been suspended. Although it is not harmful, I only add an iframe advertisement code to the back of your homepage to increase traffic, however, this will cause some browsers to bring up warnings, which makes the webmaster very painful. My ftp does not have the property to directly set files in the space,
Welcome to the Linux community forum, and interact with 2 million technical staff> recently, many spaces have been infected. Although it is not harmful, I only add an iframe advertisement code to the back of your homepage, increase the traffic, but this will make some browsers pop up a warning, so it makes the webmaster very painful. My ftp does not have the property to directly set files in the space,
Welcome to the Linux community forum and interact with 2 million technicians>
Recently, many spaces have been infected with Trojans. Although it is not harmful, you only need to append an iframe advertisement code to the back of your homepage to increase the traffic. However, this will prompt warnings to Some browsers, so it makes the webmaster very painful.
My ftp does not directly set the attributes of files in the space, so I wrote a php code to modify the index. PHP file attributes are shared with you. After setting the read-only attribute, the trojan will not have the permission to append iframe ads to the end of the file.
Set the index. php read-only code:
Function set_writeable ($ file_name)
{
If (@ chmod ($ file_name, 0555 ))
{
Echo "the read-only attribute of the index. php file has been modified successfully ";
}
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.
SET index. php to read and write code:
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 and upload it to the space. Then, you can set the Read and Write settings by browsing the address in the browser.