Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Syntax error - prośba o pomoc
smolam
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 15.10.2010

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


Witam

przy probie wrzucenia kodu Google analytics na stronę coś nagrzebałem i teraz mam problem.
Usunąłem wszystkie swoje zmiany ale nadal pojawia się błąd :

Parse error: syntax error, unexpected '=' in /home/iturystyka/ftp/main/templates/mice_1/index.php on line 90

nie mogę znaleźć przyczyny, proszę o pomoc.
przy okazji może wie ktoś jak sprawić by GA działało na php ?
kod wadliwego pliku :
  1. <?php
  2. /**
  3. * @version $Id: index.php 11407 2009-01-09 17:23:42Z willebil $
  4. * @package Joomla
  5. * @copyright Copyright (C) 2005 - 2009 Open Source Matters. All rights reserved.
  6. * @license GNU/GPL, see LICENSE.php
  7. * Joomla! is free software. This version may have been modified pursuant
  8. * to the GNU General Public License, and as distributed it includes or
  9. * is derivative of works licensed under the GNU General Public License or
  10. * other free or open source software licenses.
  11. * See COPYRIGHT.php for copyright notices and details.
  12. */
  13.  
  14.  
  15. // Set flag that this is a parent file
  16. define( '_JEXEC', 1 );
  17.  
  18. define('JPATH_BASE', dirname(__FILE__) );
  19.  
  20. define( 'DS', DIRECTORY_SEPARATOR );
  21.  
  22. require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
  23. require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
  24.  
  25. JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null;
  26.  
  27. /**
  28.  * CREATE THE APPLICATION
  29.  *
  30.  * NOTE :
  31.  */
  32. $mainframe =& JFactory::getApplication('site');
  33.  
  34. /**
  35.  * INITIALISE THE APPLICATION
  36.  *
  37.  * NOTE :
  38.  */
  39. // set the language
  40. $mainframe->initialise();
  41.  
  42. JPluginHelper::importPlugin('system');
  43.  
  44. // trigger the onAfterInitialise events
  45. JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
  46. $mainframe->triggerEvent('onAfterInitialise');
  47.  
  48. /**
  49.  * ROUTE THE APPLICATION
  50.  *
  51.  * NOTE :
  52.  */
  53. $mainframe->route();
  54.  
  55. // authorization
  56. $Itemid = JRequest::getInt( 'Itemid');
  57. $mainframe->authorize($Itemid);
  58.  
  59. // trigger the onAfterRoute events
  60. JDEBUG ? $_PROFILER->mark('afterRoute') : null;
  61. $mainframe->triggerEvent('onAfterRoute');
  62.  
  63. /**
  64.  * DISPATCH THE APPLICATION
  65.  *
  66.  * NOTE :
  67.  */
  68. $option = JRequest::getCmd('option');
  69. $mainframe->dispatch($option);
  70.  
  71. // trigger the onAfterDispatch events
  72. JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
  73. $mainframe->triggerEvent('onAfterDispatch');
  74.  
  75. /**
  76.  * RENDER THE APPLICATION
  77.  *
  78.  * NOTE :
  79.  */
  80. $mainframe->render();
  81.  
  82. // trigger the onAfterRender events
  83. JDEBUG ? $_PROFILER->mark('afterRender') : null;
  84. $mainframe->triggerEvent('onAfterRender');
  85.  
  86. /**
  87.  * RETURN THE RESPONSE
  88.  */
  89. echo JResponse::toString($mainframe->getCfg('gzip'));
  90. lowScriptAccess="always" loop="false" hspace="0" vspace="0"></embed>
  91. </object>
  92.  
  93. </center>
  94.  
  95. <table cellpadding="0" cellspacing="0" align="center">
  96. <tr>
  97. <td width="1000" align="right">
  98.  
  99. <table cellpadding="0" cellspacing="0" align="right">
  100. <tr>
  101. <td>
  102. <?php mosLoadModules ( 'user1' ); ?>
  103. </td>
  104. </tr>
  105. </table>
  106.  
  107. </td>
  108. </tr>
  109. </table>
  110.  
  111. <div style="position: absolute; width: 100%; top: 0px; left: 0px;">
  112.  
  113.  
  114.  
  115. <table cellpadding="0" cellspacing="0" width="980" border="0" align="center">
  116.  
  117. <tr>
  118. <td colspan="2" align="right" class="padd">
  119. <?php mosLoadModules ( 'top' ); ?>
  120. </td>
  121. </tr>
  122.  
  123. <tr>
  124. <td width="470">
  125.  
  126. <table cellpadding="0" cellspacing="0" width="100%" border="0" align="left">
  127. <tr><td height="160"></td></tr>
  128. <tr><td valign="top" align="left"><?php mosLoadModules ( 'user2' ); ?></td></tr>
  129. </table>
  130.  
  131. </td>
  132.  
  133. <td valign="top" align="left" style="padding-top: 15px;">
  134. <div style="overflow: auto; width: 510px; height: 370px; align: left;">
  135.  
  136. <?php mosMainBody(); ?>
  137.  
  138. </div>
  139. </td>
  140. </tr>
  141.  
  142. </table>
  143.  
  144.  
  145. </div>
  146.  
  147. </body>
  148.  
  149. </html>

Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
askone
post
Post #2





Grupa: Zarejestrowani
Postów: 654
Pomógł: 121
Dołączył: 27.10.2007
Skąd: Poznań, Łódź

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


Hej

Twój błąd spowodowany jest umieszczeniem czystego kodu HTML bezpośrednio w bloku PHP. W linii 89 wywołujesz metodę:
  1. JResponse::toString($mainframe->getCfg('gzip'));
Tutaj jeszcze wszystko jest ok, ale już linię dalej - czyli właśnie 90 - dajesz czysty kod HTML... Aby usunąć błąd musisz zamknąć blok kodu PHP przed przejściem w tryb HTML.
  1. <?php
  2. ...
  3. ...
  4. echo JResponse::toString($mainframe->getCfg('gzip'));
  5. ?>
  6. <table cellpadding="0" cellspacing="0" align="center">


Pozdrawiam

Cytat(smolam @ 15.10.2010, 12:27:10 ) *
Parse error: syntax error, unexpected '=' in /home/iturystyka/ftp/main/templates/mice_1/index.php on line 90

  1. /**
  2.  * RENDER THE APPLICATION
  3.  *
  4.  * NOTE :
  5.  */
  6. $mainframe->render();
  7.  
  8. // trigger the onAfterRender events
  9. JDEBUG ? $_PROFILER->mark('afterRender') : null;
  10. $mainframe->triggerEvent('onAfterRender');
  11.  
  12. /**
  13.  * RETURN THE RESPONSE
  14.  */
  15. echo JResponse::toString($mainframe->getCfg('gzip'));
  16. lowScriptAccess="always" loop="false" hspace="0" vspace="0"></embed>
  17. </object>
  18.  
  19. </center>
  20.  
  21. <table cellpadding="0" cellspacing="0" align="center">


--------------------
Kliknij jeśli moja odpowiedź Ci pomogła.
askone.pl
Go to the top of the page
+Quote Post
smolam
post
Post #3





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 15.10.2010

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


Dzieki za odpowiedz, mógłbyś wstawić ten znacznik dokładnie tam gdzie powinien być ? wstawiałem w rożnych miejscach i nie przyniosło to efektu. Na php nie znam się zupełnie. miedzy innymi wstawiłem tak :
  1. * RETURN THE RESPONSE
  2. */
  3. echo JResponse::toString($mainframe->getCfg('gzip'));
  4. ?>
  5. lowScriptAccess="always" loop="false" hspace="0" vspace="0"></embed>
  6. </object>
  7.  
  8. </center>
  9.  
  10. <table cellpadding="0" cellspacing="0" align="center">
  11. <tr>



ale bez efektu

Ten post edytował smolam 15.10.2010, 12:18:22
Go to the top of the page
+Quote Post
askone
post
Post #4





Grupa: Zarejestrowani
Postów: 654
Pomógł: 121
Dołączył: 27.10.2007
Skąd: Poznań, Łódź

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


Ale czy po wstawieniu w tym miejscu nadal masz SYNTAX ERROR? Tego typu błędu już nie powinno być. Ciekawi mnie czy przypadkiem nie wyciąłeś jakiejś większej części kodu bo fragment:

  1. lowScriptAccess="always" loop="false" hspace="0" vspace="0"></embed>


wygląda na wybrakowany. Zwróć uwagę, iż zamykany jest znacznik "</embed>" ale nigdzie nie jest on otwierany? Przynajmniej nigdzie jawnie...


--------------------
Kliknij jeśli moja odpowiedź Ci pomogła.
askone.pl
Go to the top of the page
+Quote Post
batman
post
Post #5





Grupa: Moderatorzy
Postów: 2 921
Pomógł: 269
Dołączył: 11.08.2005
Skąd: 127.0.0.1




1. Łączenie stringów to jedna z podstawowych czynności, jaką wykonuje się w PHP.
2. Forum nie parser. Zainstaluj dowolne IDE z kolorowaniem składni, a od razu zauważysz, gdzie masz błąd.

W związku z powyższym zamykam.


--------------------
I would love to change the world, but they won't give me the source code.
My software never has bugs. It just develops random features.
Go to the top of the page
+Quote Post

Closed TopicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 13:14