Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> js w php
trucksweb
post
Post #1





Grupa: Zarejestrowani
Postów: 1 199
Pomógł: 31
Dołączył: 22.03.2004
Skąd: Warszawa

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


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?(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/ohmy.gif) :roll2:
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 7)
kubatron
post
Post #2





Grupa: Zarejestrowani
Postów: 581
Pomógł: 0
Dołączył: 21.07.2003
Skąd: Jasło

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


Pierwsze to zmień echo ''; na echo ""; drugie w language=\"JavaScript type=text/javascript\" powinno dizałac (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) edit: i wszedzie gdzie masz borde="" itp. musisz dawac border=\"..\"

Ten post edytował kubatron 22.06.2004, 16:27:11
Go to the top of the page
+Quote Post
trucksweb
post
Post #3





Grupa: Zarejestrowani
Postów: 1 199
Pomógł: 31
Dołączył: 22.03.2004
Skąd: Warszawa

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


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 (IMG:http://forum.php.pl/style_emoticons/default/sadsmiley02.gif)

Ten post edytował trucksweb 22.06.2004, 16:38:33
Go to the top of the page
+Quote Post
kicaj
post
Post #4





Grupa: Zarejestrowani
Postów: 1 640
Pomógł: 28
Dołączył: 13.02.2003
Skąd: Międzyrzecz/Poznań

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


A nie lepiej trzymac kod JS poza znacznikami php, najlepiej jest chyba w sekcji <head> w HTML'u (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
stoprocent
post
Post #5





Grupa: Zarejestrowani
Postów: 338
Pomógł: 2
Dołączył: 17.05.2003
Skąd: Kraków , Londyn

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


  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 ;"

Ten post edytował nasto 22.06.2004, 18:48:30
Go to the top of the page
+Quote Post
trucksweb
post
Post #6





Grupa: Zarejestrowani
Postów: 1 199
Pomógł: 31
Dołączył: 22.03.2004
Skąd: Warszawa

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


dzieki sprawdze ten kod (IMG:http://forum.php.pl/style_emoticons/default/exclamation.gif) (IMG:http://forum.php.pl/style_emoticons/default/ohmy.gif) :roll2:
Go to the top of the page
+Quote Post
stoprocent
post
Post #7





Grupa: Zarejestrowani
Postów: 338
Pomógł: 2
Dołączył: 17.05.2003
Skąd: Kraków , Londyn

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


Dziala bo przed chwila sprawdzalem tylko popatrz na poprzedniego posta bo tam edit zrobilem , musqisz & # 0 9 2 ; zmienic na '
Go to the top of the page
+Quote Post
trucksweb
post
Post #8





Grupa: Zarejestrowani
Postów: 1 199
Pomógł: 31
Dołączył: 22.03.2004
Skąd: Warszawa

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


wielkie dzieki juz dziala wszystko:(IMG:http://forum.php.pl/style_emoticons/default/exclamation.gif) !! (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował trucksweb 23.06.2004, 13:51:27
Go to the top of the page
+Quote Post

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: 23.08.2025 - 18:44