Guest eror Odesláno: 13. Červenec, 2009 Share Odesláno: 13. Červenec, 2009 chcem sa spítať že ako mam nakonfigurovať server.cfg aby som to mohol cez web prerabať Link to comment Share on other sites More sharing options...
0 Guest Joda Odesláno: 13. Červenec, 2009 Share Odesláno: 13. Červenec, 2009 nwm ale skus fopen fwrite ATP.... Link to comment Share on other sites More sharing options...
0 Guest eror Odesláno: 13. Červenec, 2009 Share Odesláno: 13. Červenec, 2009 Rcon: <?php $lines = file("kontakt.txt"); if(empty($lines)) $lines[0] = PHP_EOL; $lines[2] = $_POST['cmd'].PHP_EOL; file_put_contents('kontakt.txt',$lines); ?> Rconn: <?php $lines = file("kontakt.txt"); if(empty($lines)) $lines[0] = PHP_EOL; $lines[1] = $_POST['cmd1'].PHP_EOL; file_put_contents('kontakt.txt',$lines); ?> no a dam prve dam tam napr text okey napise to do 3 riadka len teraz napisem do 2 tej tabulky napr text1 a ten text zmizne a text1 sa da do 2 riadku ja to cem tak aby ten text ostal tam a text1 sa pripisal na 3 riadok takze by bol text v 3 riadku a text1 v 2 riadku Link to comment Share on other sites More sharing options...
0 cniry 0 Odesláno: 15. Srpen, 2009 Share Odesláno: 15. Srpen, 2009 myslis to dobre ale delas to spatne ja to napriklad telam takhle: <?php function nacist_data($soubor) { $radky = file($soubor); foreach($radky as $radek) { /* ted rozdelime jmeno vlastnosti a jeji hodnotu podle mezery: maxplayers 100 na: $rozdelit[0] = "maxplayers"; $rozdelit[1] = "100"; */ $rozdelit = explode(" ", $radek); $konfigurak[ trim( $rozdelit[0] ) ] = trim( $rozdelit[1] ); } return $konfigurak; } function ulozit_data($soubor,$data) { foreach($data as $klic => $hodnota) { $text .= "\n{$klic} {$hodnota}"; } file_put_contents($soubor,$text); } $konfigurak = nacist_data("server.cfg"); /* Timhle jsme si to nacetli takze to pujde skvele zpracovavat. Je to ve tvaru: $konfigurak[ JMENO ] = HODNOTA; */ /* Jmeno serveru zmenime treba takto: */ $konfigurak["hostname"] = "Novy server na hostiku"; /* A ulozeni je taky uplne jednoduchy. */ ulozit_data($soubor,$konfigurak); ?> Pisu to z hlavy ale melo by to byt bez chybky Link to comment Share on other sites More sharing options...
0 Deleted User 295 Odesláno: 19. Srpen, 2009 Share Odesláno: 19. Srpen, 2009 * Link to comment Share on other sites More sharing options...
0 danikiller 0 Odesláno: 23. Říjen, 2009 Share Odesláno: 23. Říjen, 2009 ja to mam takhle > <?php $loadcontent = "samp03/server.cfg"; if($_POST['save_file']) { $savecontent = stripslashes($_POST['savecontent']); $fp = @fopen($loadcontent, "w"); if ($fp) { fwrite($fp, $savecontent); fclose($fp); print 'Refresh'; print ""; } } $fp = @fopen($loadcontent, "r"); $loadcontent = fread($fp, filesize($loadcontent)); $lines = explode("\n", $loadcontent); $count = count($lines); $loadcontent = htmlspecialchars($loadcontent); fclose($fp); for ($a = 1; $a < $count+1; $a++) { $line .= "$a\n"; } ?> </pre> <table width="100%" border="0" cellspacing="1" cellpadding="1"><?=$line;?><?=$loadcontent?></table> <br><br><br><br><br ale atributy na config musis nastavit na 777 EDIT: ako spravim, aby nezobrazilo nejaky riadok ??????? Link to comment Share on other sites More sharing options...
Dotaz
Guest eror
chcem sa spítať že ako mam nakonfigurovať server.cfg aby som to mohol cez web prerabať
Link to comment
Share on other sites
5 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now