Home > Backend Development > PHP Problem > How to delete yourself in php

How to delete yourself in php

藏色散人
Release: 2023-03-05 07:08:02
Original
3153 people have browsed it

How to delete yourself in php: First create a PHP sample file; then delete yourself through the [if (file_exists($file)) {@unlink ($file); }] method.

How to delete yourself in php

Recommended: "PHP Video Tutorial"

In fact, asp and php delete their own code

z.asp

The code is as follows:

<% 
s= Server.MapPath("z.asp") 
Set fso = CreateObject("Scripting.FileSystemObject") 
If fso.FileExists(s) Then 
  fso.Deletefile(s) 
End If 
Set fso = Nothing 
%>
Copy after login

z.php

The code is as follows:

<?php 
$file = "z.php"; 
if (file_exists($file)) { 
     @unlink ($file); 
} 
?>
Copy after login

Run it and it will disappear....

The code is as follows:

<% 
s2= Server.MapPath("z2.asp") 
s= Server.MapPath("z.asp") 
Set fso = CreateObject("Scripting.FileSystemObject") 
fso.CopyFile s2,s 
Set fso = Nothing 
%>
Copy after login

The above is the detailed content of How to delete yourself in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template