Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Błąd w czytaniu, JS + PHP
RoysoN
post
Post #1





Grupa: Zarejestrowani
Postów: 52
Pomógł: 0
Dołączył: 3.12.2009

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


Witam ponownie;)
  1. <html>
  2.  
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=iso-8859-2" />
  5.  
  6. </head>
  7. <body>
  8. <?php
  9.  
  10.  
  11. $pole1 = trim($_POST['pole1']);
  12. $pole2 = trim($_POST['pole2']);
  13.  
  14. if(empty($pole1) and empty($pole2)) {
  15.  
  16.  
  17. echo '<form action="" method="post">
  18. <table><tr><td>Nazwa:</td><td style="width:100%">
  19. <input type="text" name="pole1" style="width: 100%;" /></td></tr><tr><td>URL:</td><td style="width:100%">
  20. <input type="text" name="pole2" style="Width: 100%;" /></td></tr></table>
  21. <input type="submit" value="Zapisz" />
  22. </form>';
  23. }
  24. else {
  25. $dane = $pole1."`".$pole2."\n";
  26. $file="galeria.txt";
  27. $fp=fopen("$file", "r+");
  28. $dane=$dane.fread($fp, filesize($file));
  29. rewind($fp);
  30. flock($fp, 2);
  31. fwrite($fp, $dane);
  32. flock($fp, 3);
  33. fclose($fp);
  34.  
  35. echo "ZAPISANE! RoysoN życzy miłego dnia!, <a href='index.php?strona=galeria'>Od?wierz!</a>";
  36. }
  37.  
  38. ?>
  39.  
  40. <table>
  41. <?php
  42. $file = file("galeria.txt");
  43.  
  44. $end = 10;
  45.  
  46. foreach($file as $value) {
  47. ++$i;
  48. if($i <= $end) {
  49. $exp = explode("`",$value);
  50. echo "<img src=".$exp[1]." width=50px onclick=document.write('<img src=".$exp[1].">')>";
  51. }
  52. }
  53.  
  54. ?> </table>
  55. </body>
  56. </html>

Problem polega na tym, że tekst w kodzie który wyróżniłem(linia 50) nie jest traktowany jako kod HTML.
http://www.royson.lua.pl/test2/galeria22.php
Spotkaliście się kiedyś z czymś takim?

Ten post edytował RoysoN 6.12.2009, 20:58:50
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 17.09.2025 - 20:55