Speed Posted October 2, 2006 Report Share Posted October 2, 2006 kaa uztaisit lai viena faila nevaretu ierakstit divreiz vienu textu ??? Link to comment Share on other sites More sharing options...
Orion7 Posted October 2, 2006 Report Share Posted October 2, 2006 Nu tev ir jānolasa faila saturs (file_get_contents()) un jaunais teksts jāsalīdzina ar esošo faila saturu (izmantojot strstr($fails, $teksts)) vai tur jau tāds teksts ir. Tā kā nav zināms, kā tieši ir formatēts teksts tajā failā, tad konkrētāk neko nevarēšu pateikt. Link to comment Share on other sites More sharing options...
Speed Posted October 2, 2006 Author Report Share Posted October 2, 2006 Nu tev ir jānolasa faila saturs (file_get_contents()) kas ir tieshi jadara ar to (file_get_contents()) ??? Link to comment Share on other sites More sharing options...
andrisp Posted October 2, 2006 Report Share Posted October 2, 2006 Tu taču saproti, ka tas ir fjas nosaukums ? Dodies uz php.net un apskati. Link to comment Share on other sites More sharing options...
Speed Posted October 2, 2006 Author Report Share Posted October 2, 2006 Tu taču saproti, ka tas ir fjas nosaukums ? Dodies uz php.net un apskati. tur nau normali paskaidrots ;( Link to comment Share on other sites More sharing options...
andrisp Posted October 2, 2006 Report Share Posted October 2, 2006 (edited) Kā nav normāli ? Ja nesaporti angliski, tad varbūt mēģini krieviski. Edited October 2, 2006 by andrisp Link to comment Share on other sites More sharing options...
Speed Posted October 2, 2006 Author Report Share Posted October 2, 2006 nevari vienk piemeru uzrakstit ? sry esmu iesacejs ar php nemos tikai nedelu Link to comment Share on other sites More sharing options...
v3rb0 Posted October 2, 2006 Report Share Posted October 2, 2006 pieņemu ka vienāds texts nozīmē vienādas rindas tad echo in_array('es jau esmu ierakstits'."\n", file('fails.txt'))?'ir':'nav'; Link to comment Share on other sites More sharing options...
Speed Posted October 2, 2006 Author Report Share Posted October 2, 2006 pieņemu ka vienāds texts nozīmē vienādas rindas tad echo in_array('es jau esmu ierakstits'."\n", file('fails.txt'))?'ir':'nav'; sitas man neder mana txt faila atrodas sadas rindas dfs-cs.sytes.net:27015 cs.gign.lv:27015 advanced-cs1.sytes.net:27015 csdm.apollo.lv:27015 war3.bagem.lv:27015 newtnt.sytes.net:27015 87.110.145.204:27015 un es vinas nevaru mainit bet lai in_array ietu tur jabut komatiem :( Link to comment Share on other sites More sharing options...
Stopp Posted October 2, 2006 Report Share Posted October 2, 2006 kādiem vēl komatiem? Link to comment Share on other sites More sharing options...
andrisp Posted October 3, 2006 Report Share Posted October 3, 2006 Droši vien Speed grib izmantot $arr = explode(',', $faila_saturs);.. Tu vari darīt šādi - $arr = explode('\n', $faila_saturs);.. Ir tādi 'neredzamie' simboli. Viens no tiem ir pārnešana jaunā rindā. Link to comment Share on other sites More sharing options...
Stopp Posted October 3, 2006 Report Share Posted October 3, 2006 ar ko explode("\n", file_get_contents("fails.txt"); atšķirtos no file("fails.txt"); ? Link to comment Share on other sites More sharing options...
Speed Posted October 3, 2006 Author Report Share Posted October 3, 2006 ar koexplode("\n", file_get_contents("fails.txt"); atšķirtos no file("fails.txt"); ? tnx teu man tag vis izdevas :) Link to comment Share on other sites More sharing options...
Speed Posted October 7, 2006 Author Report Share Posted October 7, 2006 <html> <head> <title>serveris pievienots</title> <body <?php require_once "maincore.php"; require_once "subheader.php"; require_once "side_left.php"; ?> <a href='servers.php'><h5>Spied te<h5> <?php echo "<h6>lai ietu atpakal<h6>" if ($servers == file('servers.txt')) { echo "Serveris jau atrodas datu bazee!" require_once "side_right.php"; require_once "footer.php"; exit; } $txt = fopen('lgsl_servers.txt', 'a', 1); $text = " $servers"; fwrite($txt, $text); fclose($txt); $file = fopen("servers.txt",'a', 1); $texts = ", $servers"; fwrite($file,$texts); fclose($file); require_once "side_right.php"; require_once "footer.php" ?> </body> </html> kads man varetu pateikt kapec rada Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in c:\appserv\www\gatavs.php on line 13 Link to comment Share on other sites More sharing options...
bubu Posted October 7, 2006 Report Share Posted October 7, 2006 Aptuvens tulkojums, izlaižot nesvarīgo: "Sintaktiska kļūda, nav gaidīts IF, ir jābūt ; 13 rindiņā". Link to comment Share on other sites More sharing options...
Recommended Posts