Parse error: syntax error, unexpected T_GLOBAL (1 viewing) (1) Guest
Favoured: 0
|
|
|
TOPIC: Parse error: syntax error, unexpected T_GLOBAL
|
kksou (Admin)
Admin
Posts: 443
|
|
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(''', "'", $str);
$str = str_replace('"', '"', $str);
$str = str_replace('<', '<', $str);
$str = str_replace('>', '>', $str);
$str = str_replace('&', '&', $str);
$str = str_replace(' ', ' ', $str);
$str = str_replace(' ', "\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.
|
kksou (Admin)
Admin
Posts: 443
|
|
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.
|
|
|
|
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.
|
kksou (Admin)
Admin
Posts: 443
|
|
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.
|
|
|
|
|