Pomoc - Szukaj - U¿ytkownicy - Kalendarz
Pe³na wersja: js w php
Forum PHP.pl > Forum > Gotowe rozwi±zania
trucksweb
MAM JPORTALA I CHCE POD logiem umiescic skrypt java. oto kod calosci:

  1. <?php
  2. # poczatek strony (do bannera)
  3. # =======================
  4.  
  5.  
  6. function header_open() {
  7.  
  8. global $color;
  9.  
  10.  
  11. echo '
  12. <script language=JavaScript type=text/javascript>
  13. <!-- Begin
  14. function displayWindow(url, width, height){
  15. var Win = window.open(url,\"displayWindow\",'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no' );
  16. }
  17. function addPanel()
  18. {
  19. if ((typeof window.sidebar == \"object\") && (typeof window.sidebar.addPanel == \"function\"))
  20. window.sidebar.addPanel(\"News - Szukaj\",\"javascript:void(open('search.phtml?dzial=','_search'))\",\"\");
  21. }
  22. // End -->
  23. </SCRIPT>
  24.  
  25. <META content=\"Microsoft FrontPage 4.0\" name=GENERATOR>
  26. </head>
  27.  
  28. <body>
  29. <div align=\"center\">
  30. <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"205\" width=\"765\">
  31.  <tr>
  32. <td width=\"763\" colspan=\"3\" height=\"201\">
  33. <p align=\"center\"><img src=\"logo.jpg\" width=\"763\" height=\"199\" ></p>
  34. </td>
  35.  </tr>
  36.  <tr>
  37.  <td width=\"197\" align=\"center\" height=\"4\"> <embed width=\"138\" height=\"31\" src=\"http://members.lycos.co.uk/truckswebb/paliwa.swf\"></td>
  38.  <td width=\"203\" align=\"center\" height=\"4\"> <IFRAME
  39. src=\"start_pliki/scroller.htm\" frameBorder=0 width=\"100%\"
  40. scrolling=no height=60></IFRAME><BR> </td>
  41.  <td width=\"363\" align=\"center\" height=\"4\"><embed width=\"320\" height=\"40\" src=\"kierowca.swf\" align=\"left\"> </td>
  42.  </tr>
  43.  </table>
  44. </div>
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. ';
  56.  
  57. ............
  58. }
  59. ?>

jednak gdy tak wkleje wyskakuje blad:
Cytat
Parse error: parse error in /data/members/free/tripod/uk/t/r/u/trucksweb/htdocs/theme/white2/functions.inc.php on line 28

Fatal error: Call to undefined function: header_open() in /data/members/free/tripod/uk/t/r/u/trucksweb/htdocs/theme/white2/index.php on line 62


jak polaczyc js z php???ktos wie?questionmark.gif ohmy.gif :roll2:
kubatron
Pierwsze to zmieñ echo ''; na echo ""; drugie w language=\"JavaScript type=text/javascript\" powinno diza³ac tongue.gif edit: i wszedzie gdzie masz borde="" itp. musisz dawac border=\"..\"
trucksweb
zrobilem tak
  1. <?php
  2. function header_open() {
  3.  
  4. global $color;
  5.  
  6.  
  7. echo '<script language=\"JavaScript type=text/javascript\">
  8. <!-- Begin
  9. function displayWindow(url, width, height){
  10. var Win = window.open(url,\"displayWindow\",'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no' );
  11. }
  12. function addPanel()
  13. {
  14. if ((typeof window.sidebar == \"object\") && (typeof window.sidebar.addPanel == \"function\"))
  15. window.sidebar.addPanel(\"News - Szukaj\",\"javascript:void(open('search.phtml?dzial=','_search'))\",\"\");
  16. }
  17. // End -->
  18. </SCRIPT>
  19.  
  20. </head>
  21.  
  22. <body>
  23. <div align=\"center\">
  24. <table \"border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"205\" width=\"765\"\">
  25.  <tr>
  26. <td width=\"763\" colspan=\"3\" height=\"201\">
  27. <p align=\"center\"><img src=\"logo.jpg\" width=\"763\" height=\"199\" ></p>
  28. </td>
  29.  </tr>
  30.  <tr>
  31.  <td width=\"197\" align=\"center\" height=\"4\"> <embed width=\"138\" height=\"31\" src=\"http://members.lycos.co.uk/truckswebb/paliwa.swf\"></td>
  32.  <td width=\"203\" align=\"center\" height=\"4\"> <IFRAME
  33. src=\"start_pliki/scroller.htm\" frameBorder=\"0 width=\"100%\"
  34. scrolling=no height=60\"></IFRAME><BR> </td>
  35.  <td width=\"363\" align=\"center\" height=\"4\"><embed width=\"320\" height=\"40\" src=\"kierowca.swf\" align=\"left\"> </td>
  36.  </tr>
  37.  </table>
  38. </div>
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. ';
  50.  
  51.  
  52. }
  53. ?>


i niestety to samo sadsmiley02.gif
kicaj
A nie lepiej trzymac kod JS poza znacznikami php, najlepiej jest chyba w sekcji <head> w HTML'u smile.gif
stoprocent
  1. <?php
  2.  
  3. echo '<script language=\"JavaScript type=text/javascript\">
  4. <!-- Begin
  5. function displayWindow(url, width, height){
  6. var Win = window.open(url,\"displayWindow\",'width=&#092;' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no' );
  7. }
  8. function addPanel()
  9. {
  10. if ((typeof window.sidebar == &#092;"object\") && (typeof window.sidebar.addPanel == \"function\"))
  11. window.sidebar.addPanel(&#092;"News - Szukaj\",\"javascript:void(open('search.phtml?dzial=','_search'))\",\"\");
  12. }
  13. //  End -->
  14. </SCRIPT>
  15.  
  16. </head>
  17.  
  18. <body>
  19. <div align=\"center\">
  20. <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"205\" width=\"765\">
  21.    <tr>
  22.       <td width=\"763\" colspan=\"3\" height=\"201\">
  23.         <p align=\"center\"><img src=\"logo.jpg\" width=\"763\" height=\"199\" ></p>
  24.       </td>
  25.    </tr>
  26.    <tr>
  27.      <td width=\"197\" align=\"center\" height=\"4\"> <embed width=\"138\" height=\"31\" src=\"http://members.lycos.co.uk/truckswebb/paliwa.swf\"></td>
  28.      <td width=\"203\" align=\"center\" height=\"4\"> <IFRAME
  29.                   src=\"start_pliki/scroller.htm\" frameBorder=\"0 width=\"100%\"
  30.                   scrolling=no height=60\"></IFRAME><BR> </td>
  31.      <td width=\"363\" align=\"center\" height=\"4\"><embed width=\"320\" height=\"40\" src=\"kierowca.swf\" align=\"left\"> </td>
  32.    </tr>
  33. </table>
  34. </div>
  35.  
  36. ';
  37.  
  38. ?>


tylko tego krzaka po width= zamien na \ , O tego -> " & # 0 9 2 ;"
trucksweb
dzieki sprawdze ten kod exclamation.gif ohmy.gif :roll2:
stoprocent
Dziala bo przed chwila sprawdzalem tylko popatrz na poprzedniego posta bo tam edit zrobilem , musqisz & # 0 9 2 ; zmienic na '
trucksweb
wielkie dzieki juz dziala wszystko:exclamation.gif!! smile.gif
To jest wersja lo-fi g³ównej zawarto¶ci. Aby zobaczyæ pe³n± wersjê z wiêksz± zawarto¶ci±, obrazkami i formatowaniem proszê kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.