Muserver file edit [PHP]

Results 1 to 13 of 13
  1. #1
    Proficient Member kashak is offline
    MemberRank
    Mar 2006 Join Date
    155Posts

    Muserver file edit [PHP]

    PHP Code:
    <?
    $filedit
    ['misc']['files'] = 'commonserver.cfg,EventManagement.dat,Monster.txt,MonsterSetBase.txt,Shop0.txt,Shop1.txt,Shop2.txt,Shop3.txt,Shop4.txt,Shop5.txt,Shop6.txt,Shop7.txt,Shop8.txt,Shop9.txt,Shop10.txt,Shop11.txt,Shop12.txt,Shop13.txt,Shop14.txt,Shop15.txt,Shop16.txt,eventitembag.txt,eventitembag1.txt,eventitembag2.txt,eventitembag3.txt,eventitembag4.txt,eventitembag5.txt,eventitembag6.txt,eventitembag7.txt,eventitembag8.txt,eventitembag9.txt,eventitembag10.txt,eventitembag11.txt,eventitembag12.txt,eventitembag13.txt,eventitembag14.txt,eventitembag15.txt,eventitembag16.txt,eventitembag17.txt,eventitembag18.txt,eventitembag19.txt,eventitembag20.txt,eventitembag21.txt,eventitembag22.txt,eventitembag23.txt,eventitembag24.txt,eventitembag25.txt,eventitembag26.txt,eventitembag27.txt,eventitembag28.txt,eventitembag29.txt,eventitembag30.txt,eventitembag31.txt,eventitembag32.txt,eventitembag33.txt,eventitembag34.txt,eventitembag35.txt';

    $file explode(",",$filedit['misc']['files']);
    $i 0;
    $menu "<form method='post' action=''><center><select name='files'>";
    while (@
    $file[$i]) {
    $menu .= "<option value=".$file[$i].">".$file[$i]."</option>";
    $i++;
    }
    $menu .= "</select><input type='submit' id='doit' name='doit' value='Select'></form></center><br />";
    echo 
    "$menu";
    //Show Selected File
    if(isset($_POST['doit'])) {
    $files $_POST['files'];
    $filesizes filesize("D://muserver//data//$files");
    $file fopen("D://muserver//data//$files"r");
    $fread fread($file$filesizes); 
    fclose($file);
    echo 
    "<form method='post' action=''>
    <table align='center'>
    <tr><td><textarea name='text' id='text' rows='30' cols='70'> 
    $fread</textarea></td></tr>
    <tr><td align='center'><input type='hidden' id='file' name='file' value='
    $files'><input type='submit' id='submit' name='submit' value='Update!'></td></tr></table></form>";
    }
    //Upgrade the selected file
    if(isset($_POST['submit'])) {
    $text $_POST['text'];
    $files $_POST['file'];
    $file fopen("D://muserver//data//$files"w+") or die(); 
    $fread fwrite($file,$text); 
    fclose($file);
    echo 
    "<center>Succesfully update!</center>";
    }
    ?>
    enjoy!
    Attached Thumbnails Attached Thumbnails 1.png   2.png  


  2. #2
    Alpha Member iBimbo is offline
    MemberRank
    Oct 2007 Join Date
    Section 192Location
    2,423Posts

    Re: [Release] Muserver file edit [PHP]

    Approved.

    Would be great if you posted a guide for noobies on how to make the php file.

    Also, this is nothing near secure.

    You should make something wich checks ip or something, and wich only allows local ip and GM ip's.

    Or maybe a login module...

  3. #3
    Account Upgraded | Title Enabled! RisingKing2010 is offline
    MemberRank
    Feb 2006 Join Date
    loc( 'RisingKing', 'USA' );Location
    1,362Posts

    Re: [Release] Muserver file edit [PHP]

    its sorta pointless since you can do the same thing with notepad...
    also it would be better to make an exe for it...
    why go thru the trouble of setting up a webserver + webpage to edit the configurations...
    nice script tho ;)

  4. #4
    Valued Member Ale[!] is offline
    MemberRank
    Feb 2008 Join Date
    ArgentinaLocation
    136Posts

    Re: [Release] Muserver file edit [PHP]

    :D

    thanks 10/10 :=)

    good work-...

  5. #5
    Enthusiast Hijacker is offline
    MemberRank
    Jun 2008 Join Date
    32Posts

    Re: [Release] Muserver file edit [PHP]

    Nice job man

  6. #6
    Apprentice BinFlux is offline
    MemberRank
    May 2008 Join Date
    notepadLocation
    5Posts

    Re: [Release] Muserver file edit [PHP]

    At least, add something like this
    PHP Code:
    if ($_SERVER['REMOTE_ADDR'] != "ip"){ die('You do not have permission to view this page.'); } 

  7. #7
    Banned DarkMaster. is offline
    BannedRank
    Feb 2007 Join Date
    BulgariaLocation
    812Posts

    Re: [Release] Muserver file edit [PHP]

    credits: Mephisto ?

  8. #8
    Valued Member -DaSH- is offline
    MemberRank
    May 2008 Join Date
    RomaniaLocation
    124Posts

    Re: [Release] Muserver file edit [PHP]

    credits: BluMan...

  9. #9
    Account Upgraded | Title Enabled! themad is offline
    MemberRank
    Dec 2004 Join Date
    BulgariaLocation
    1,018Posts

    Re: [Release] Muserver file edit [PHP]

    PHP Code:
    <?php
    $datapath    
    "D:\MuServer\data\\";
    $files        = array(
                
    "commonserver.cfg",
                
    "monster.txt",
                
    "monstersetbase.txt",
                
    "chaoscastle.dat",
                
    "eventmanagement.dat",
                
    "mapserverinfo.dat",
                
    "mucastledata.dat",
                
    "shop0.txt",
                
    "shop1.txt",
                
    "shop2.txt",
                
    "shop3.txt",
                
    "shop4.txt",
                
    "shop5.txt",
                
    "shop6.txt",
                
    "shop7.txt",
                
    "shop8.txt",
                
    "shop9.txt",
                
    "shop10.txt",
                
    "shop11.txt",
                
    "shop12.txt",
                
    "shop13.txt",
                
    "gate.txt",
                
    "eventitembag.txt",
                
    "eventitembag2.txt",
                
    "eventitembag3.txt",
                
    "eventitembag4.txt",
                
    "eventitembag5.txt",
                
    "eventitembag6.txt",
                
    "eventitembag7.txt",
                
    "eventitembag8.txt",
                
    "eventitembag9.txt",
                
    "eventitembag10.txt",
                
    "eventitembag11.txt",
                
    "eventitembag12.txt",
                
    "eventitembag13.txt",
                
    "eventitembag14.txt",
                
    "eventitembag15.txt",
                
    "eventitembag16.txt",
                
    "eventitembag17.txt",
                
    "eventitembag18.txt",
                
    "castledeepevent.dat",
                
    "devilsquare.dat",
                
    "bloodcastle.dat",
                
    "connectmember.txt"
            
    );
    function  
    adminaccess($vl) {
        if (
    $_SERVER['REMOTE_ADDR']=='127.0.0.1')
            return 
    true;
        else
            return 
    false;
    }
    $filename        $_POST['thefile'];
    $t_files        count($files);
    $f_keys            = array();
    $f_keys            $files;
    $filename        $datapath.$filename;
    if ((
    file_exists($filename)) && (!empty($_POST['thefile']))) {
            
    $s_content .= "<input id=\"thefile\" name=\"thefile\" type=\"disabled\" size=\"".strlen($_POST['thefile'])."\" readonly=\"readonly\" value=\"".htmlspecialchars($_POST['thefile'])."\"><br><a onClick=\"xweb('file_editor');\">Select another file</a>";

    else {
            
    $s_content        "<select id=\"thefile\" name=\"thefile\">";
            
    $i            0;
            while(
    $i<$t_files) {
                
    $s_content    .="<option "
                if (
    $f_keys[$i]==$_POST['thefile']) { 
                    
    $s_content .= "selected"
                } 
                
    $s_content .= " id=\"".$f_keys[$i]."\" name=\"".$f_keys[$i]."\">".$f_keys[$i]."</option>";
                
    $i++;
            }
            
    $s_content    .= "</select>";
        }
        if (!
    adminaccess("EditDataFiles")) {
            echo 
    "You ain't got what it takes to touch things around here!";
        } else {
        if ((
    in_array($_POST['thefile'], $files)) && (!empty($_POST['content']))) {
            
    $fp fopen ($filename"w");
            if (!
    fwrite($fpaddslashes($_POST['content'])))
                echo 
    "Failed to modify file";
            else echo 
    "file modified successfully!!";
            
    fclose($fp);
        }
        
        
    $fp         fopen ($filename"rw");
        
    $content     fread ($fpfilesize ($filename));
        echo 
    "<br><fieldset style=\"width: 90%\"><form method=\"post\" action=\"\">".$s_content."<br><br><textarea rows='30'"; if ((!file_exists($filename)) || (empty($_POST['thefile']))) { echo "style=\"display: none;\" disabled=\"disabled\""; } echo " cols='80' style=\"color: #DDDDDD; font-family: tahoma; font-size: 11px;\" name='content'>".stripslashes($content)."</textarea><br><br><input type=submit value=\"Go!\"></form></fieldset><br>";
        
    fclose ($fp);
    }
    ?>
    my old code..... i won't be needing this anymore so here u go..
    change the adminaccess function to ur desire ...
    since im no longer using any of my scripts, ill release some of them when i get back home

  10. #10
    Alpha Member Maxim.T is offline
    MemberRank
    Nov 2006 Join Date
    RussiaLocation
    1,834Posts

    Re: [Release] Muserver file edit [PHP]

    themad , it would be really great to release ur web or previous versions

  11. #11
    Alpha Member iBimbo is offline
    MemberRank
    Oct 2007 Join Date
    Section 192Location
    2,423Posts

    Re: [Release] Muserver file edit [PHP]

    Quote Originally Posted by RisingKing2010 View Post
    its sorta pointless since you can do the same thing with notepad...
    also it would be better to make an exe for it...
    why go thru the trouble of setting up a webserver + webpage to edit the configurations...
    nice script tho ;)
    Because this kind is great if your PC isn't the best, and it takes forever to login to remote (If you have a dedi).

    Also, for co-admins this would be good.

  12. #12
    Apprentice mendotawi is offline
    MemberRank
    Nov 2006 Join Date
    20Posts

    Re: [Release] Muserver file edit [PHP]

    ya, and if you where out of house u can log in and edit something ^^, Great Job..!!

  13. #13
    Novice encundide is offline
    MemberRank
    May 2010 Join Date
    1Posts

    Chimbichreurb

    elapharbarode
    <a href="http://avsrekdncsk.com">aw5g</a>



Advertisement