PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Parse error: syntax error, unexpected T_GLOBAL (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Parse error: syntax error, unexpected T_GLOBAL
#982
kksou (Admin)
Admin
Posts: 443
graph
User Online Now Click here to see the profile of this user
Re:Parse error: syntax error, unexpected T_GLOBAL 2 Months, 3 Weeks ago Karma: 8  
Hi Salvatore,

Yes, it's those double-byte or unicode characters that cause the error.

Could you please edit the file DirectPHP again and add the following to line 81:

Code:
$str = str_replace(chr(hexdec('C2')).chr(hexdec('A0')), '', $str);
so that it looks like:
Code:
function fix_str2($str) {
	$str = str_replace('<br>', "\n", $str);
	$str = str_replace('<br />', "\n", $str);
	$str = str_replace('<p>', "\n", $str);
	$str = str_replace('</p>', "\n", $str);
	$str = str_replace('&#39;', "'", $str);
	$str = str_replace('&quot;', '"', $str);
	$str = str_replace('&lt;', '<', $str);
	$str = str_replace('&gt;', '>', $str);
	$str = str_replace('&amp;', '&', $str);
	$str = str_replace('&nbsp;', ' ', $str);
	$str = str_replace('&#160;', "\t", $str);
	$str = str_replace(chr(hexdec('C2')).chr(hexdec('A0')), '', $str);
	return $str;
}
    Let me know if it works...
      Regards,
        /kksou
         
         
        Last Edit: 2008/10/11 23:40 By kksou.
          The administrator has disabled public write access.
        #983
        kksou (Admin)
        Admin
        Posts: 443
        graph
        User Online Now Click here to see the profile of this user
        Re:Parse error: syntax error, unexpected T_GLOBAL 2 Months, 3 Weeks ago Karma: 8  
        Hi Salvatore,

        I've just added the code above to DirectPHP. You can download the latest copy from:

        http://www.kksou.com/php-gtk2/Joomla/DirectPHP-plugin.php

        I think the new version should be able to remove those double-byte or unicode characters, which I believe is added to your content by your editor for some unknown reason. I'm using Joomla English version. I think you are using a non-English version. Hence the additional double-byte or unicode characters. Try pumping this into a PHP eval() statement. It's these characters that cause the error.

        Regards,
        /kksou
         
          The administrator has disabled public write access.
        #986
        salrandazzo (User)
        Fresh Boarder
        Posts: 6
        graphgraph
        User Offline Click here to see the profile of this user
        Re:Parse error: syntax error, unexpected T_GLOBAL 2 Months, 3 Weeks ago Karma: 0  
        Hi Kksou, very good job indeed!
        Now it works perfectly. I'll try to use it to read a database with result of a survay made, on a different website, using Facile Forms on joomla 1.0. Did you already update also jommla 1.0 version? Thank you again for your fast intervention, ON SUNDAY! :-D
        Have a nice week!.
        Salvo
         
          The administrator has disabled public write access.
        #994
        kksou (Admin)
        Admin
        Posts: 443
        graph
        User Online Now Click here to see the profile of this user
        Re:Parse error: syntax error, unexpected T_GLOBAL 2 Months, 3 Weeks ago Karma: 8  
        Hi Salvatore,

        Glad it works!

        Yes, have updated both the 1.0 and 1.5 version.

        Regards,
        /kksou
         
          The administrator has disabled public write access.
        Go to top Post Reply
        Powered by FireBoardget the latest posts directly to your desktop

        Blog - Forum - Privacy Policy - Contact Us
        Copyright © 2006-2009. kksou.com. All Rights Reserved