Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z kodem
pajdakks
post
Post #1





Grupa: Zarejestrowani
Postów: 51
Pomógł: 0
Dołączył: 13.01.2010

Ostrzeżenie: (0%)
-----


Witam,
mam kod :

index.php
  1. <html>
  2.  
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
  5. <title>New Page 2</title>
  6. </head>
  7.  
  8. <body>
  9. <?php
  10. $pole1 = trim($_POST['pole1']);
  11. $pole2 = trim($_POST['pole2']);
  12. $pole3 = trim($_POST['pole3']);
  13. $pole4 = trim($_POST['pole4']);
  14. $pole5 = trim($_POST['pole5']);
  15.  
  16. if(empty($pole1) and empty($pole2)and empty($pole3) and empty($pole4) and empty($pole5) ) {
  17. echo '<form action="" method="post">
  18. <center>
  19.  
  20. <p><select name="pole1" size="20">
  21. <option>asddsadsad</option>
  22. <option>sdsadsa</option>
  23. <option>dssadsad</option>
  24. <option>sdasdsa</option>
  25. <option>dasdda</option>
  26. </select>
  27.  
  28. <p>Stan licznika.</p><textarea name="pole2" style="width: 200px; height: 100px;">
  29.  
  30. </textarea><br />
  31.  
  32. <p><textarea name="pole5" cols="20" rows="1"></textarea>
  33.  
  34. <input type="submit" value="Zapisz" />
  35.  
  36. </form></center>';
  37. }
  38. else {
  39.  
  40.  
  41. $dane = $pole1."`".$pole2.$pole3."`".$pole4."`".$pole5."`". "\n";
  42. $file = "baza.txt";
  43.  
  44. $fp = fopen($file, "a");
  45.  
  46. flock($fp, 2);
  47.  
  48. fwrite($fp, $dane);
  49.  
  50. flock($fp, 3);
  51.  
  52. fclose($fp);
  53. echo include('podglad.php');
  54. }
  55.  
  56. ?>
  57.  
  58. </body>
  59.  
  60. </html>



I

poglad.php
  1. <html>
  2.  
  3. <head>
  4. <meta http-equiv="Content-Language" content="pl">
  5. <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
  6. <title>New Page 2</title>
  7. </head>
  8.  
  9. <body>
  10.  
  11.  
  12. <table border="1" width="939" height="346">
  13. <tr>
  14. <td height="47" width="230">Pajda - 1</td>
  15. <td height="45" width="320">pajda 2</td>
  16. <td height="44" width="367">pajda 3</td>
  17. </tr>
  18. <tr>
  19. <td height="289" width="230">
  20. <?php
  21. $file = file("baza.txt");
  22.  
  23. foreach($file as $value) {
  24.  
  25. $exp = explode("`",$value);
  26.  
  27. echo $exp[0]."<p>" ;
  28.  
  29. }
  30.  
  31. ?></td>
  32. <td height="291" width="320"><?php
  33. $file = file("baza.txt");
  34.  
  35. foreach($file as $value) {
  36.  
  37. $exp = explode("`",$value);
  38.  
  39. echo $exp[1]."<p>" ;
  40.  
  41. }
  42.  
  43. ?></td>
  44. <td height="292" width="367"><?php
  45. $file = file("baza.txt");
  46.  
  47. foreach($file as $value) {
  48.  
  49. $exp = explode("`",$value);
  50.  
  51. echo $exp[3]."<p>" ;
  52.  
  53. }
  54.  
  55. ?></td>
  56. </tr>
  57. </table>
  58.  
  59. </body>
  60.  
  61. </html>



www.pajda-wolsztyn.eu.php

I teraz moje pytanie jest następujące skąd pod tabela jest "1" ?
I chce zrobić, że jak naduszę guzik to all z "baza.txt" się wyczyści.

Pozdrawiam
Go to the top of the page
+Quote Post
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Cytat
I teraz moje pytanie jest następujące skąd pod tabela jest "1" ?

nie: echo include('podglad.php');
a: include('podglad.php');

starajmy sie uzywac funkcji ze zrozumieniem

Cytat
I chce zrobić, że jak naduszę guzik to all z "baza.txt" się wyczyści.
leże i płaczę ze smiechu. Postaram sie odpowiedziec twoim slangiem:
Jak juz nadusisz ten guzik to ten guzik niech krzyknie: joł, all, klirnijcie się

Przepraszam, nie mogłem się powstrzymac... na forum.php.pl staraj się uzywac poprawnej polszczyzny a nie jakis mieszancow


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
pajdakks
post
Post #3





Grupa: Zarejestrowani
Postów: 51
Pomógł: 0
Dołączył: 13.01.2010

Ostrzeżenie: (0%)
-----


super... dzięki za taką pomoc.
Go to the top of the page
+Quote Post
nospor
post
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




hej, zadales dwa pytania. Na pierwsze pytanie udzielilem ci poprawnej odpowiedzi.
Na drugie pytanie nie udzielilem ci odpowiedzi a zwrocilem ci uwage na twoj styl wypowiedzi. Być może niepotrzebnie użyłem tutaj Twojego stylu ale myslalem ze lepiej zrozumiesz smile.gif

Czego sie więc unosisz?


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
pajdakks
post
Post #5





Grupa: Zarejestrowani
Postów: 51
Pomógł: 0
Dołączył: 13.01.2010

Ostrzeżenie: (0%)
-----


Nie unoszę się...
Czekam dalej na pomoc w sprawie 2 pytania.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 07:00