Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]postac zmiennej
shaolin33
post
Post #1





Grupa: Zarejestrowani
Postów: 136
Pomógł: 0
Dołączył: 5.10.2012

Ostrzeżenie: (10%)
X----


witam,

Chciałbym aby zmienna miała postac tekstu w HTML
o tresci:

  1. <p class=MsoNormal style='text-align:justify'><span style='font-size:10.0pt;
  2. font-family:"Arial","sans-serif"'>oraz<o:p></o:p></span></p>
  3.  
  4. <p class=MsoNormal style='text-align:justify'><span style='font-size:10.0pt;
  5. font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>
  6.  
  7. <table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width=897
  8. style='width:672.95pt;border-collapse:collapse;border:none;mso-border-alt:
  9. solid black .5pt;mso-border-themecolor:text1;mso-yfti-tbllook:1184;mso-padding-alt:
  10. 0cm 5.4pt 0cm 5.4pt;mso-border-insideh:none;mso-border-insidev:none'>
  11. <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
  12. <td width=377 valign=top style='width:283.1pt;border-top:solid black 1.0pt;
  13. mso-border-top-themecolor:text1;border-left:solid black 1.0pt;mso-border-left-themecolor:
  14. text1;border-bottom:none;border-right:none;mso-border-top-alt:solid black .5pt;
  15. mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;
  16. mso-border-left-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt'>
  17. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><b
  18. style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
  19. "Arial","sans-serif";mso-ansi-language:PL'>Współposiadaczem</span></b><b
  20. style='mso-bidi-font-weight:normal'><span lang=X-NONE style='font-size:10.0pt;
  21. font-family:"Arial","sans-serif"'> rachunku </span></b><span lang=X-NONE
  22. style='font-size:10.0pt;font-family:"Arial","sans-serif"'>(imiona i nazwisko)</span><span
  23. lang=X-NONE style='font-size:10.0pt;font-family:"Arial","sans-serif";
  24. mso-ansi-language:PL'> </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
  25. mso-ansi-language:PL'><b><? echo $dane[30]; ?>&nbsp;<? echo $dane[31]; ?>&nbsp;<? echo $dane[32]; ?></b><o:p></o:p></span></p>
  26. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><span
  27. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  28. PL'><br>legitymującym/cą się:<o:p></o:p></span></p>
  29. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><span
  30. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  31. PL'><? if ($dane[69]=="dowód osobisty") echo "[X]" ; else echo "[&nbsp;&nbsp]" ; ?> dowodem osobistym o numerze: <? if ($dane[69]=="dowód osobisty") echo "$dane[40]" ;?><o:p></o:p></span></p>
  32. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><span
  33. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  34. PL'><? if ($dane[69]=="paszport") echo "[X]" ; else echo "[&nbsp;&nbsp]" ; ?> paszportem o numerze: <? if ($dane[69]=="paszport") echo "$dane[40]" ;?><o:p></o:p></span></p>
  35. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><span
  36. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  37. PL'><? if ($dane[69]=="inny") echo "[X]" ; else echo "[&nbsp;&nbsp]" ; ?> innym o numerze: <? if ($dane[69]=="inny") echo "$dane[40]" ;?><o:p></o:p></span></p>
  38. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><span
  39. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  40. PL'>Posiadającym/cą PESEL numer: <? echo $dane[39]; ?> <o:p></o:p></span></p>
  41. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><u><span
  42. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  43. PL'><o:p><span style='text-decoration:none'>&nbsp;</span></o:p></span></u></p>
  44. </td>
  45. <td width=520 valign=top style='width:389.85pt;border-top:solid black 1.0pt;
  46. mso-border-top-themecolor:text1;border-left:none;border-bottom:none;
  47. border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:
  48. solid black .5pt;mso-border-top-themecolor:text1;mso-border-right-alt:solid black .5pt;
  49. mso-border-right-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt'>
  50. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><u><span
  51. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  52. PL'><o:p><span style='text-decoration:none'>&nbsp;</span></o:p></span></u></p>
  53. </td>
  54. </tr>
  55. <tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes'>
  56. <td width=377 valign=top style='width:283.1pt;border-top:none;border-left:
  57. solid black 1.0pt;mso-border-left-themecolor:text1;border-bottom:solid black 1.0pt;
  58. mso-border-bottom-themecolor:text1;border-right:none;mso-border-left-alt:
  59. solid black .5pt;mso-border-left-themecolor:text1;mso-border-bottom-alt:solid black .5pt;
  60. mso-border-bottom-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt'>
  61. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><u><span
  62. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  63. PL'>Adres zamieszkania<o:p></o:p></span></u></p>
  64. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><span
  65. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  66. PL'><? echo $dane[41]; ?>&nbsp;<? echo $dane[42]; ?>&nbsp;<? if ($dane[43]=="") echo "" ; else echo "/"?>&nbsp;<? echo $dane[43]; ?><o:p></o:p></span></p>
  67. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><span
  68. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  69. PL'><? echo $dane[46]; ?>&nbsp;<? echo $dane[45]; ?><u><o:p></o:p></u></span></p>
  70. </td>
  71. <td width=520 valign=top style='width:389.85pt;border-top:none;border-left:
  72. none;border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;
  73. border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-bottom-alt:
  74. solid black .5pt;mso-border-bottom-themecolor:text1;mso-border-right-alt:
  75. solid black .5pt;mso-border-right-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt'>
  76. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><u><span
  77. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  78. PL'>Adres do korespondencji:<o:p></o:p></span></u></p>
  79. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><span
  80. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  81. PL'><? if ($dane[47]=="") echo "Taki sam jak adres zamieszkania" ; else echo "$dane[47] $dane[48] /$dane[49]"?><o:p></o:p></span></p>
  82. <p class=MsoFooter style='text-align:justify;tab-stops:35.4pt center 8.0cm right 16.0cm'><span
  83. style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-ansi-language:
  84. PL'><? echo $dane[52]; ?>&nbsp;<? echo $dane[51]; ?><u><o:p></o:p></u></span></p>
  85. </td>
  86. </tr>


potem chce to wyświetlić w innym miejscu pod jakims warunkiem


zapisuje sobie zmienna w taki sposob:

  1.  
  2. <?php
  3.  
  4. $zmienna_tekst_html = ' cały html podany powyżej '
  5.  
  6.  
  7. ?>
  8.  


tylko wyskakuje mi błąd
czy to problem z napisem ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Monter08
post
Post #2





Grupa: Zarejestrowani
Postów: 237
Pomógł: 22
Dołączył: 16.09.2010
Skąd: Lubaczów

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


Wyskakuje Ci błąd, ponieważ masz apostrof w różnych miejscach. Nie rozumiem w ogóle co Ty chcesz stworzyć bo muszę przyznać trochę namieszane masz, jeżeli jednak chcesz to tak zrobić na siłę to stwórz funkcje będzie Ci łatwiej, albo użyj skróconą wersje ifa jeżeli chcesz to zrobić w zmiennej, lecz przyznam nadal, że nie strasznie mieszasz.
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: 25.08.2025 - 14:48