|
Subject
|
PHP error w/ translation script...
|
| | Posted by | xionstudios (DH New User
) | | Posted on | 12/20/06 00:44 AM |
|
|
Hey, all! I've got a translator script that SHOULD work beautifully, but when all's said & done, I get loads of errors... Below is the cut & paste of it all:
>>>>>>>this is in my .htaccess file<<<<<<<<<< RewriteEngine On RewriteRule ^([^/]{2})/(.*)$ /websitetranslator/index.php?lang=$1&url=$2 [L]
>>>>>>this is the script called in my page<<<<<< <? include("http://".$_SERVER["HTTP_HOST"]."/websitetranslator/flags.php?site_url=".$_SERVER["HTTP_HOST"]."&page=".$_SERVER["REQUEST_URI"]."");?>
>>>>>>this is the error message that flashes on-screen<<<<<<<< Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.jazzycat/xionmac/phf.charliemcelvy.com/_beta_/index.php on line 97
Warning: include(http://www.phf.charliemcelvy.com/websitetranslator/flags.php?site_url=www.phf.charliemcelvy.com&page=/_beta_/index.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.jazzycat/xionmac/phf.charliemcelvy.com/_beta_/index.php on line 97
Warning: include() [function.include]: Failed opening 'http://www.phf.charliemcelvy.com/websitetranslator/flags.php?site_url=www.phf.charliemcelvy.com&page=/_beta_/index.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/.jazzycat/xionmac/phf.charliemcelvy.com/_beta_/index.php on line 97
The heck is wrong here?? Please LMK if you have an idea as to what's up with this...!
Best!! Charlie
|
|
|
|
|
|
OK -- I've gotten past MOST of my errors; they apparently were stemming from DH's block of the allow_url_fopen function (why? my understanding is that there's no REAL security issue with leaving this active...??)
Anyway, here's the new error I get, having substituted the 'HTTP_HOST' with 'DOCUMENT_ROOT' in all applicable files:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/.jazzycat/xionmac/phf.charliemcelvy.com/_beta_/index.php on line 97
That line (#97) reads as such:
<? include($_SERVER["DOCUMENT_ROOT"]"/websitetranslator/flags.php?site_url="$_SERVER["DOCUMENT_ROOT"]"&page="$_SERVER["REQUEST_URI"]"");?>
Help! I'm trying to get a non-profit's site to have the ability to be viewed in most languages on the fly...!
Thanks in advance! Charlie
|
|
|
|
Subject
|
Re: PHP error w/ translation script...
[re: xionstudios]
|
| | Posted by | monte (DH New User
) | | Posted on | 12/26/06 07:17 AM |
|
|
You need to concatenate the strings and the vars in this line: <? include($_SERVER["DOCUMENT_ROOT"]"/websitetranslator/flags.php?site_url="$_SERVER["DOCUMENT_ROOT"]"&page="$_SERVER["REQUEST_URI"]"");?>
so it looks like this: <? include($_SERVER["DOCUMENT_ROOT"] . "/websitetranslator/flags.php?site_url=" . $_SERVER["DOCUMENT_ROOT"] . "&page=" . $_SERVER["REQUEST_URI"]);?>
I believe that should fix it, sorry for the late reply.
|
|
|
|
Subject
|
Re: PHP error w/ translation script...
[re: monte]
|
| | Posted by | xionstudios (DH Dreamling) | | Posted on | 12/26/06 07:24 PM |
|
|
Hey, late replies are better than none! I'm a beggar, can't be a chooser, too ;)
BUT, now I get this error:
Warning: include(/home/xionmac/phf.charliemcelvy.com/websitetranslator/flags.php?site_url=/home/xionmac/phf.charliemcelvy.com&page=/) [function.include]: failed to open stream: No such file or directory in /home/.jazzycat/xionmac/phf.charliemcelvy.com/index.php on line 98
Warning: include() [function.include]: Failed opening '/home/xionmac/phf.charliemcelvy.com/websitetranslator/flags.php?site_url=/home/xionmac/phf.charliemcelvy.com&page=/' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/.jazzycat/xionmac/phf.charliemcelvy.com/index.php on line 98
HALP! :-)
Charlie
|
|
|
|
Subject
|
Re: PHP error w/ translation script...
[re: xionstudios]
|
| | Posted by | monte (DH New User
) | | Posted on | 12/27/06 10:25 AM |
|
|
maybe try $_SERVER['PHP_SELF'] instead of $_SERVER['DOCUMENT_ROOT']
|
|
|
|
Subject
|
Re: PHP error w/ translation script...
[re: monte]
|
| | Posted by | xionstudios (DH Dreamling) | | Posted on | 12/27/06 01:04 PM |
|
|
Well, the errors aren't getting any worse ;)
Warning: include(/index.php/websitetranslator/flags.php?site_url=/index.php&page=/) [function.include]: failed to open stream: No such file or directory in /home/.jazzycat/xionmac/phf.charliemcelvy.com/index.php on line 46
Warning: include() [function.include]: Failed opening '/index.php/websitetranslator/flags.php?site_url=/index.php&page=/' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/.jazzycat/xionmac/phf.charliemcelvy.com/index.php on line 46
PS -- thanks for your help in this!
CM
|
|
|