JAnka123 Posted March 9, 2005 Report Share Posted March 9, 2005 Sveicināti... kā uztaisīt, lai teksts lapā tiktu nolasīts no .doc vai .txt faila... runa nav par vienkārši faila atvēršanu, vajag paskaidrojumus blakus bildēm... Link to comment Share on other sites More sharing options...
Kavacky Posted March 9, 2005 Report Share Posted March 9, 2005 Tas, kur pēc tam to tekstu bāzt, jau ir vienalga. $kautkas = file('fails.txt') // $kautkas ir array, katrā elementā viena rindiņa no faila $handle = fopen('fails.txt', 'r'); $kautkas = fread($handle, filesize('fails.txt')); // ielasa visu garā stringā fclose($handle); Link to comment Share on other sites More sharing options...
JAnka123 Posted March 9, 2005 Author Report Share Posted March 9, 2005 Ideja bija tāda, lai tekstu uzrakstītu normālā latviešu valodā ar visām garumzīmēm un tad tiki spraust web lapā, a to Homesite+ to latviešu valodu ne pārāk.. Link to comment Share on other sites More sharing options...
Kavacky Posted March 9, 2005 Report Share Posted March 9, 2005 Ideja bija tāda, lai tekstu uzrakstītu normālā latviešu valodā ar visām garumzīmēm un tad tiki spraust web lapā, a to Homesite+ to latviešu valodu ne pārāk..Un kas tev liedz to tekstu tā uzrakstīt? Link to comment Share on other sites More sharing options...
JAnka123 Posted March 9, 2005 Author Report Share Posted March 9, 2005 (edited) zini, es īsti neiebraucu tajā php gabaliņā... :unsure: Edited March 9, 2005 by JAnka123 Link to comment Share on other sites More sharing options...
Kavacky Posted March 9, 2005 Report Share Posted March 9, 2005 zini, es īsti neiebraucu tajā php gabaliņā... :unsure:Kurā daļā tieši? Link to comment Share on other sites More sharing options...
JAnka123 Posted March 9, 2005 Author Report Share Posted March 9, 2005 (edited) abos... jēgu es saprotu, bet kā to pareizi integrēt html tekstā... nesanāk man... Edited March 9, 2005 by JAnka123 Link to comment Share on other sites More sharing options...
Kavacky Posted March 10, 2005 Report Share Posted March 10, 2005 1) PHP sākas ar "<?php" un beidzas ar "?>". <?php echo 'Tūbijs saka atā, atā!'; ?> 2) Izvadam tekstu: <?php $handle = fopen('fails.txt', 'r'); $kautkas = fread($handle, filesize('fails.txt')); // ielasa visu garā stringā fclose($handle); echo '<div align="center"><font face="Verdana" color="#AA6666"><b>'.$kautkas.'</b></font></div>'; // Drukā HTML ?> Izvada tekstu jaunā divā, ar šādu krāsu, pie tam boldā. Link to comment Share on other sites More sharing options...
JAnka123 Posted March 10, 2005 Author Report Share Posted March 10, 2005 (edited) tā komanda ievada failā to? mani interesēja, kad tiek izlobīts viss teksts no txt vai doc faila un izvadīts web lapā ;) Edited March 10, 2005 by JAnka123 Link to comment Share on other sites More sharing options...
Kavacky Posted March 10, 2005 Report Share Posted March 10, 2005 Tā nebūs gluži komanda, bet gan kods. Tas garākais gabals atver failu ar nosaukumu "fails.txt" ( mainīt pēc izvēles ) un visu tā saturu izdrukā lapā, ko rāda klientam. <!-- kautkas.php --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>blablablabla</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <?php $handle = fopen('fails.txt', 'r'); $kautkas = fread($handle, filesize('fails.txt')); // ielasa visu garā stringā fclose($handle); echo '<div align="center"><font face="Verdana" color="#AA6666" size="2"><b>'.$kautkas.'</b></font></div>'; // Drukā HTML ?> </body> </html> Parāda lapā visu faila "fails.txt" saturu. Ja tajā failā ir rakstīts "Muhamed Jihad Allah Akbar!", tad lapā būs redzams "Muhamed Jihad Allah Akbar!" Link to comment Share on other sites More sharing options...
Venom Posted March 10, 2005 Report Share Posted March 10, 2005 NB: šeit varēja izmantot arī include 'fails.txt'; Link to comment Share on other sites More sharing options...
Delfins Posted March 10, 2005 Report Share Posted March 10, 2005 da neprot jams php un nemaz nejedz kas tas ir :) iekš boot.lv tas pats topiks... XML-RPC ir atbilde. un tekstus glabāt vienkāršā xml failā. Link to comment Share on other sites More sharing options...
JAnka123 Posted March 10, 2005 Author Report Share Posted March 10, 2005 thx, Kavacky ;) Link to comment Share on other sites More sharing options...
JAnka123 Posted March 10, 2005 Author Report Share Posted March 10, 2005 nākamias jautājums - Kā izlobīt tekstu no word dokumenta, tagad viņš izloba tekstu + saraksta visādus hieroglifus... Link to comment Share on other sites More sharing options...
bubu Posted March 10, 2005 Report Share Posted March 10, 2005 ctrl+c, ctrl+v? Link to comment Share on other sites More sharing options...
Recommended Posts