Author |
Message |
Donovan
Client

Joined: Oct 07, 2003
Posts: 735
Location: Ohio
|
Posted:
Sat Mar 04, 2006 9:55 am |
|
I have been getting this page sporatically when accessing some of the admin scripts in my module.
Quote: | Forbidden
You don't have permission to access /admin.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. |
Every script in my admin folder pretty much has the same block of code in the begining:
Code:if ( !defined('ADMIN_FILE')) {
die("Illegal File Access");
}
define('INDEX_FILE', false);
$index = 0;
get_lang($module_name);
include_once("header.php");
$module_name = basename(dirname(__FILE__));
global $module_name, $db, $prefix;
|
And they all make use of $admin_file such as:
Code:echo "<form name=\"addmedal\" action=\"".$admin_file.".php\" method=\"post\">";
|
Should I also declare $admin_file as global? Would this help, or is this hit or miss? |
|
|
 |
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat Mar 04, 2006 12:01 pm |
|
If you are using it within a function, most definitely define it at the top of the function definition as global. I have forgotten this many a time and with the same affect.
Now, this also assumes that you have already included mainfile.php, which is where the config.php script gets included. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Donovan

|
Posted:
Sat Mar 04, 2006 3:50 pm |
|
Would I include mainfile.php only in my admin/index.php, or include mainfile.php in all my pages as well? |
|
|
|
 |
montego

|
Posted:
Sat Mar 04, 2006 5:16 pm |
|
In my opinion, you really should have your admin/index.php script "drive" everything. I even set my own define at the top of my index.php and test for that define through all my included pages so that I am only using the ADMIN_FILE test once through my index.php.
If ALL your functions go through your case.php/index.php, then mainfile.php can be called once there.
However, this may or may not be the case with header.php and footer.php. Depending on what you need to do, you may wish to control these through each individual script. Really depends on what you are needing to control in the output. To be honest, I would bet that including header.php somewhere before your case statement in your index.php and then the footer.php before the closing of your index.php would be what you want. But, again, it depends on your design and what your admin module needs to do. |
|
|
|
 |
craeyon
Hangin' Around

Joined: Jun 04, 2006
Posts: 40
|
Posted:
Wed Jul 19, 2006 11:01 pm |
|
I am having pretty much the same problem but its not limited to the modules. Well if Newsletter is a module then ok i am having the same problem. (When i hit preview it shows me that exact error) plus this is on other parts of the admin system too. Everything was working perfectly but this started to happen recently.
I tried to understand the php lingo up there but i m helpless. i am having trouble accessing alot of my superadmin tools. Any suggestions as to how i can fix this?
Thank you. |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Thu Jul 20, 2006 12:14 am |
|
I would start by looking at what you have changed on the site recently - new blocks, new modules, updates etc.
These errors usually occur for a reason and do not normally 'just start happening' without some sort of 'help'. |
|
|
|
 |
craeyon

|
Posted:
Thu Jul 20, 2006 10:11 am |
|
nothing i didn't change anything. the last thing i changed was that userinfo block as in installed it. But..that was a long time ago.
plus now my users are starting to get this:
Forbidden
You don't have permission to access /modules.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. |
|
|
|
 |
gregexp
The Mouse Is Extension Of Arm

Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol
|
Posted:
Thu Jul 20, 2006 11:59 am |
|
A server can put a restriction on the amount of times a single script is called on, Check to see if your server has done any security upgrades. |
_________________ For those who stand shall NEVER fall and those who fall shall RISE once more!! |
|
 |
 |
Guardian2003

|
Posted:
Thu Jul 20, 2006 2:01 pm |
|
|
|
 |
craeyon

|
Posted:
Thu Jul 20, 2006 2:19 pm |
|
Its www.digitaldistrict.net
ok i am not gettin errors now that i perma-delted the User info block. But it was exactly like the one Raven uses on his site
the one that tell whose online and stuff. I don't know what went wrong. But thanks guys.
I really wish there was thing such as a diagnostic test for phpnuke  |
|
|
|
 |
Guardian2003

|
Posted:
Thu Jul 20, 2006 3:25 pm |
|
I think Raven has his own who-is-where block for download here that you could try but thaks for confirming that you have found the cause of your problem, I appreciate that. |
|
|
|
 |
craeyon

|
Posted:
Thu Jul 20, 2006 5:27 pm |
|
YUP
ok yeah umm i see Raven has a much different "Site Info" block. And for some reason i cannot find it under his downloads. Any suggestions? Should i email raven?
Thanks. |
|
|
|
 |
|