![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 117 Pomógł: 0 Dołączył: 2.05.2003 Ostrzeżenie: (0%) ![]() ![]() |
Witam zrobilem sobie edytowanie zapisanych w plikach "dat" informacji. Lecz pojawil sie jeden blad. Mianowicie skrypt nie wyswietla mi w textarea informacji z pliku *.dat. Zaprezentuje skrypt moze on cos rozwiaze.
formularz.php3 Kod <table width="280" align=center style="border: 1px solid black" cellspacing=1 cellpadding=1>
<!--DWLayoutTable--> <form action="index.php?page=dodaj" method=post> <tr> <td width="100%" height="16" valign="top">Aktualizuj:</td> </tr> <tr> <td valign="top"><textarea cols=50 rows=10 name=tresc></textarea></td> </tr> <tr> <td ><input type=submit value=Dodaj> <input type=reset value=Reset> <br> </td> </tr> </form> </table> dodaj.php3 [php:1:40ff30a823]<?php $fp = fopen('includes/dat/aktual.dat', 'r'); $stareDane = fread($fp, filesize('includes/dat/aktual.dat')); fclose($fp); $data = date("d.m.Y"); $noweDane="$data||$trescn"; $noweDane .= $stareDane; $fp = fopen('includes/dat/aktual.dat', 'w'); fputs($fp, $noweDane); fclose($fp); echo("Aktualizacja zostala dodana. Zobacz aktualizacje <a href=index.php?page=index>tutaj</a>"); ?>[/php:1:40ff30a823] edit.php3 [php:1:40ff30a823]<? $file = file("includes/dat/aktual.dat"); $total = count($file); for($i=0; $total > $i; $i++){ $info = explode("||", $file[$i]); } ?> <table width="280" align=center style="border: 1px solid black" cellspacing=1 cellpadding=1> <!--DWLayoutTable--> <form action="index.php?page=dodaj" method=post> <tr> <td width="100%" height="16" valign="top">Edytuj</td> </tr> <tr> <td valign="top"><textarea cols=50 rows=10 name=tresc value="<? echo $info[0]; ?>"></textarea></td> </tr> <tr> <td ><input type=submit value=Edit> <input type=reset value=Reset> <br> </td> </tr> </form> </table>[/php:1:40ff30a823] Wklejam wszystkie pliki by wszytko bylo jasne (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) . Pozdrawiam (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) |
|
|
![]()
Post
#2
|
|
Grupa: Zarząd Postów: 2 277 Pomógł: 6 Dołączył: 27.12.2002 Skąd: Wołów/Wrocław ![]() |
1. topic przyklejony na forum php.
2. jeżeli [php:1:acdc8e03f2]<?php $noweDane="$data||$trescn"; ?>[/php:1:acdc8e03f2] to [php:1:acdc8e03f2] <textarea cols=50 rows=10 name=tresc value="<? echo $info[0]; ?> </textarea> [/php:1:acdc8e03f2] wyświetlić powino datę... |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 117 Pomógł: 0 Dołączył: 2.05.2003 Ostrzeżenie: (0%) ![]() ![]() |
Wwlasnie chodzi o to ze nie wyswietla niczego. Probowalem $info[0] i $info[1], lecz nic nie mam w edycji. Wkleje plik dat by wszystko bylo jasne
Kod 16.07.2003||- cos tam<br>- cos tam2
16.07.2003||- cos tam<br>- cos tam 16.07.2003||- cos tam<br>- cos tam |
|
|
![]()
Post
#4
|
|
Grupa: Zarząd Postów: 2 277 Pomógł: 6 Dołączył: 27.12.2002 Skąd: Wołów/Wrocław ![]() |
sprawdź po koleji
[php:1:113b79a4b0]<?php //1. var_dump ($total); // = count($file); //2 var_dump ($info ); //= explode("||", $file[$i]); ?>[/php:1:113b79a4b0] |
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 117 Pomógł: 0 Dołączył: 2.05.2003 Ostrzeżenie: (0%) ![]() ![]() |
Jezeli mialem pozastepowac to zastapilem i wyskoczyl mi NUL (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
|
|
|
![]()
Post
#6
|
|
Grupa: Zarejestrowani Postów: 2 064 Pomógł: 1 Dołączył: 22.01.2003 Skąd: Poznań Ostrzeżenie: (0%) ![]() ![]() |
HTML się kłania :-)
[php:1:d08dabed35]<?php <textarea costam="costam">TRESC</textarea> ?>[/php:1:d08dabed35] |
|
|
![]()
Post
#7
|
|
Grupa: Zarząd Postów: 2 277 Pomógł: 6 Dołączył: 27.12.2002 Skąd: Wołów/Wrocław ![]() |
ups. to było banalne. przepraszam za sugestie prowadzące w błędnym kierunku.
(spenalzo + za spostrzegawczość (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) ) |
|
|
![]()
Post
#8
|
|
Grupa: Zarejestrowani Postów: 117 Pomógł: 0 Dołączył: 2.05.2003 Ostrzeżenie: (0%) ![]() ![]() |
Bravoo!!! Dziala (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 22.08.2025 - 15:50 |