|
-
August 24th, 2008, 12:13 AM
#1
Java script error in my cpanel being recognised by my admin panel
I am getting an error in my admin panel to my website and therefore it wont let me compile my changes that I am making to other pages. In my cpanel, I have located the area of the error, but I am not very good at java script. Can someone please look at this cpanel script to see what is wrong:
PHP Code:
{
$resKeysStrings = db_res("
SELECT `LocalizationKeys`.`Key` AS `Key`,
`LocalizationStrings`.`String` AS `String`
FROM `LocalizationStrings` INNER JOIN
`LocalizationKeys` ON
`LocalizationKeys`.`ID` = `LocalizationStrings`.`IDKey`
WHERE `LocalizationStrings`.`IDLanguage` = {$arrLanguage['ID']}");
$handle = fopen("{$dir['root']}langs/lang-{$arrLanguage['Name']}.php", 'w');
if($handle === false) return false;
$fileContent = "<?{$newLine}\$LANG = array(";
while($arrKeyString = mysql_fetch_assoc($resKeysStrings))
{
$langKey = str_replace("\\", "\\\\", $arrKeyString['Key']);
$langKey = str_replace("'", "\\'", $langKey);
$langStr = str_replace("\\", "\\\\", $arrKeyString['String']);
$langStr = str_replace("'", "\\'", $langStr);
$fileContent .= "{$newLine}\t'$langKey' => '$langStr',";
}
The following is the admin panel error message:
Warning: fopen(/home/sexiestf/public_html/langs/lang-English.php) [function.fopen]: failed to open stream: Permission denied in /home/sexiestf/public_html/inc/languages.inc.php on line 159
Language file(s) has NOT been compiled due to an error.
Last edited by PeejAvery; August 25th, 2008 at 09:47 AM.
Reason: Added PHP tags.
-
August 24th, 2008, 01:20 AM
#2
Re: Java script error in my cpanel being recognised by my admin panel
-
August 24th, 2008, 02:34 AM
#3
Re: Java script error in my cpanel being recognised by my admin panel
That's not JavaScript. That's PHP.
The first thing to do is to go and
1) check that "/home/sexiestf/public_html/langs/lang-English.php" exists.
2) check what permissions are set for the file (if you're using cPanel, they'll be somewhere)
3) If the permissions are set to (d*mn, I've forogtten the permission settings, but I think it's) 755, Look at the php settings (if you can't access them directly, make a page like this:
PHP Code:
<?php phpinfo(); ?>
Look for anything which may stop you opening files (I'm in a web cafe currently, so I can't look things up easily)
4) Try a relative path. Here I'm assuming it's to do with the path you using. If you're call from inc/languages.php, then try:
PHP Code:
fopen("../langs/lang-{$arrLanguage['Name']}.php", 'w');
Hope that helps.
Help from me is always guaranteed!*
VB.NET code is made up on the spot with VS2008 Professional with .NET 3.5. Everything else is just made up on the spot.
Please Remember to rate posts, use code tags, send me money and all the other things listed in the "Before you post" posts.
*Guarantee may not be honoured.
-
August 25th, 2008, 09:47 AM
#4
Re: Java script error in my cpanel being recognised by my admin panel
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
August 25th, 2008, 09:50 AM
#5
Re: Java script error in my cpanel being recognised by my admin panel
PHP's fopen is highly restricted when PHP is running in safe mode. I would check to see if it is first. Then worry about it being other problems.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|