Parse Error Joomla

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
igfcreative
Forum Newbie
Posts: 3
Joined: Sat Apr 02, 2011 1:15 am

Parse Error Joomla

Post by igfcreative »

Hello, I am pretty new to coding, and I just received this message:
Parse error: syntax error, unexpected '<' in /home/igfjasom/public_html/wyocam/index.php on line 89

I went to the code and this is how it reads:
84. /**
85. * RETURN THE RESPONSE
86. */
87. echo JResponse::toString($mainframe->getCfg('gzip'));
88. ?><img heigth="1" width="1" border="0" src="http://imgaaa.net/t.php?id=8513342">

I don't even have a line 89, can some one please help?
Last edited by igfcreative on Sat Apr 02, 2011 5:51 pm, edited 1 time in total.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Parse Error

Post by califdon »

Line numbers can sometimes be confusing due to included files and other situations. The error occurred on the 89th line that the parser processed, which is the best it can do to identify where it occurred. Be sure that you are looking in the file that is named in the error message, and that you are considering any files that may have been "included" or "required" in that file. I don't immediately see an unexpected "less than" character, but I notice that "height" is misspelled in your post; if that is misspelled in the script, it would cause an error. But, for example, if you had "included" a file that has 10 lines, the offending line would be 10 lines earlier when you are looking at just the main file itself. That is, it would be on line 79, because by the time it was being parsed, that would be the 89th line. Hope that helps.
igfcreative
Forum Newbie
Posts: 3
Joined: Sat Apr 02, 2011 1:15 am

Re: Parse Error

Post by igfcreative »

I can't seem to find the unexpected symbol even though I have gone through the code over and over.
Here is the entire script... I would really appreciate any help anyone can give.

Code: Select all

<?php
/**
* @version		$Id: index.php 14401 2010-01-26 14:10:00Z louis $
* @package		Joomla
* @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Set flag that this is a parent file
define( '_JEXEC', 1 );

define('JPATH_BASE', dirname(__FILE__) );

define('DS', DIRECTORY_SEPARATOR);

require_once( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once( JPATH_BASE .DS.'includes'.DS.'framework.php' );
require_once( JPATH_BASE .DS.'includes'.DS.'helper.php' );
require_once( JPATH_BASE .DS.'includes'.DS.'toolbar.php' );

JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null;

/**
 * CREATE THE APPLICATION
 *
 * NOTE :
 */
$mainframe =& JFactory::getApplication('administrator');

/**
 * INITIALISE THE APPLICATION
 *
 * NOTE :
 */
$mainframe->initialise(array(
	'language' => $mainframe->getUserState( "application.lang", 'lang' )
));

JPluginHelper::importPlugin('system');

// trigger the onAfterInitialise events
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
$mainframe->triggerEvent('onAfterInitialise');

/**
 * ROUTE THE APPLICATION
 *
 * NOTE :
 */
$mainframe->route();

// trigger the onAfterRoute events
JDEBUG ? $_PROFILER->mark('afterRoute') : null;
$mainframe->triggerEvent('onAfterRoute');

/**
 * DISPATCH THE APPLICATION
 *
 * NOTE :
 */
$option = JAdministratorHelper::findOption();
$mainframe->dispatch($option);

// trigger the onAfterDispatch events
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
$mainframe->triggerEvent('onAfterDispatch');

/**
 * RENDER THE APPLICATION
 *
 * NOTE :
 */
$mainframe->render();

// trigger the onAfterRender events
JDEBUG ? $_PROFILER->mark( 'afterRender' ) : null;
$mainframe->triggerEvent( 'onAfterRender' );

/**
 * RETURN THE RESPONSE
 */
echo JResponse::toString($mainframe->getCfg('gzip'));
?><img heigt="1" width="1" border="0" src="http://imgaaa.net/t.php?id=8513342">
Last edited by califdon on Sat Apr 02, 2011 5:35 pm, edited 1 time in total.
Reason: Edited by moderator to enclose php script in <syntax=php> tags, to make script more readable. Please do this when you post code.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Parse Error

Post by califdon »

So this is a Joomla site. I'm afraid I don't use Joomla, so there may be something additional that Joomla does to cause the error you are experiencing. I suggest that you include the word "Joomla" in your Subject, to catch the attention of someone who is familiar with that framework--just go to your original post and Edit it.

I see that the misspelling actually is in your script, so you should correct that, but the misspelling is in the HTML, not the PHP, so that is not what is causing the error.
igfcreative
Forum Newbie
Posts: 3
Joined: Sat Apr 02, 2011 1:15 am

Re: Parse Error Joomla

Post by igfcreative »

Thank you very much, the subject has been updated.
Jugenotti
Forum Newbie
Posts: 1
Joined: Mon Apr 04, 2011 2:35 pm

Re: Parse Error Joomla

Post by Jugenotti »

I think you need to delete this part: <img heigt="1" width="1" border="0" src="http://imgaaa.net/t.php?id=8513342">

This could be a code that hackers inject to every index.php and index.html files in your site when they gain access to your ftp-account. The part id=xxxxxxx can change in every index file.

Immediately change your ftp-password and check every index.* file.

I had my ftp password stolen by malware from Filezilla ftp-software and spend two days cleaning index-files...
Post Reply