Jump to content
xisto Community

OwenMelbz

Members
  • Content Count

    2
  • Joined

  • Last visited

Everything posted by OwenMelbz

  1. yh but wanted a bit more than that.I've actually finished the code now and is shown below <? // BTW IM COMMENTING EVERYTHING FOR Uecho "<title>Server Config Editor</title>";////////////////////// Teh Variables //////////////////////$host = ''; // host - if u setup the database crap this will change according$port = 21; // ftp port, shudnt need to change$timeout = 10; // yh same aplies$user = ''; // setup database crap to set this to FTP username$pass = ''; // setup database so this is the FTP password$secure = false; // If OpenSSL support is not active, this wont work, so change it to false$con = ftp_connect ( $host, $port, $timeout ) ; //making the connect function smaller//////////////////////////////////////////////if ( isset ( $_GET [ 'copy' ] ) ){//////////////////////////////////////////////////// PART ONE - Teh Legend Of Teh TempZ0R Filez /////////////////////////////////////////////////////$theText = $_POST["tehconfig"]; // name of the config edit field thing$theText = stripslashes($theText); // removes crap so form dnt *BLEEP*up$data = fopen("temp.txt", "w"); // opening the temp filefwrite($data,$theText); // putting the crap inside itfclose($data); // closing the whole thingecho "<script type=\"text/javascript\"> function delayer(){ window.location = \"?process\" } </script><body onLoad=\"setTimeout('delayer()', 3000)\">Processing Server Config This May Take A Few Seconds...</body>";}elseif ( isset ( $_GET [ 'process' ] ) ){//////////////////////////////////////////// PART TWO - TEH UPLOADING OF TEMPZOR /////////////////////////////////////////////function clean ( ){ //making suer no left oversforeach ( $_REQUEST as $key => $val ){ // looking around$_REQUEST [ $key ] = stripslashes ( strip_tags ( htmlspecialchars ( $val, ENT_QUOTES ) ) ) ;// converting the *BLEEP*$$key = stripslashes ( strip_tags ( htmlspecialchars ( $val, ENT_QUOTES ) ) ) ;}} // making it smallerclean ( ) ; //finish the cleaningif ( @ftp_login ( $con, $user, $pass ) ) {// if login to ftp actually works$path = "./"; //might need to play with for differnt games$upload = ftp_nb_put ( $con, "server.cfg", "temp.txt", FTP_BINARY ) ; //uploading the temp file to ftp and renaming it to server.cfgwhile ( $upload == FTP_MOREDATA ) {//while teh upload is going play around with the left over dataecho "."; // <-- dno why$ret = ftp_nb_continue ( $con ) ;}// carry on the ftp connectionif ( $upload != FTP_FINISHED ) {//onces the ftp proccess has donedie ( '=/ file didnt upload- go bug Lee' ) ;} //if it failed say thisecho 'Server Config Updated<p>'; }// once it worked say thiselse {echo 'LAWLS DIDNT LOGIN RIGHT'; }// finished part of the login if it didnt login say thatecho "<a href='index.php'>BACK</a>"; }// just a link back a pageelse{echo '<form method="post" action="?copy"><textarea name="tehconfig" cols="70" rows="20">'?><?php include ("http://forums.xisto.com/no_longer_exists/;); ?><? echo'</textarea> <br><input type="submit" name="submit" value="Update Config"></form>';}////////////////////////////////////////////////////// Teh End - I think it will be worth a tennner xD /////////////////////////////////////////////////////?>
  2. Right Im new here and stuggling with a problem im having.I've currently got a Login Script to login to a external ftp and it displays the folders contents, however i need it so it echos a specific file (coursedata.cfg) into a formarea which you can then edit the file and when u click save it overwrites the file with the new one.Im really quiet getting annoyed with it xD as everything i do ends up trying to include the file from the webserver the script is hosted on and not the external ftp source.thanksFull Code Bellow
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.