Author |
Message |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Wed Dec 31, 2008 3:37 pm |
|
Now this is probably something I did lol, but just wanted to see if anyone else ever had this problem.
When I go to admin.php I get a completely blank page. No source code what so ever.
If I go to admin.php?op=adminMain it works fine.
Any ideas? |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan.
Last edited by Palbin on Thu Jan 01, 2009 5:27 pm; edited 1 time in total |
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Wed Dec 31, 2008 4:21 pm |
|
Actually yes but it might not be applicable in this instance. In my case I had uploaded an old (pre nuke 7.5) module - you know the ones where the admin side has admin/xx files instead of modules/ModuleName/admin/xx
Turned out as I'm using Ubuntu, I uploaded the whole 'admin' directory for the module and it had some bizzare directory permissions which then got transferred when the directory was uploaded.
It also did the same thing to my admin 'images' directory and I couldn't see any icons when I did get to the admin screen. |
|
|
|
 |
jakec
Site Admin

Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom
|
Posted:
Thu Jan 01, 2009 3:35 pm |
|
I think I had something similar before, but once I cleared my browsers cache it was OK. |
|
|
|
 |
Palbin

|
Posted:
Thu Jan 01, 2009 5:31 pm |
|
|
|
 |
Susann
Moderator

Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support
|
Posted:
Thu Jan 01, 2009 5:59 pm |
|
If you are able to do a validation check you will find out why the page is blank and why there isn´t a source code I believe. |
|
|
|
 |
Palbin

|
Posted:
Thu Jan 01, 2009 6:08 pm |
|
|
|
 |
Susann

|
Posted:
Thu Jan 01, 2009 6:20 pm |
|
Try Tidy. Are there any errors, warnings ?
I had blank pages before and the validator gave me the information I needed. |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Tue Jan 06, 2009 5:39 am |
|
This can also be a messed up case statement, i.e., a missing one in the various system and/or module case files, but it is odd that it is when just going to admin.php with no query string. I am really surprised that with $display_errors on and dblogging on, that nothing is showing up. |
_________________ 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! |
|
|
 |
Palbin

|
Posted:
Tue Jan 06, 2009 6:16 am |
|
The problem was related to a notice about an undefined variable $op. I had added an if statement and a $op = ''; and that is what was causing this. Guardian added a mantis issue about it.
I can't reproduce the undefined $op though  |
|
|
|
 |
montego

|
Posted:
Tue Jan 06, 2009 7:13 am |
|
Was your if statement like this:
if (!isset($op)) $op = '';
??
If so, I can't see how that would cause this issue. Weird. |
|
|
|
 |
Palbin

|
Posted:
Tue Jan 06, 2009 1:22 pm |
|
That is exactly what Guardian and I had. I don't know if that caused an isset($op)to get mad or what. It was really werid.
Look at issue 1317 if interested. |
|
|
|
 |
evaders99
Former Moderator in Good Standing

Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Wed Jan 07, 2009 1:46 am |
|
Pretty sure its this code in admin.php
Code:
if(!isset($op)) {
$op = 'adminMain';
|
That sets the default op for the admin
I haven't tested any code, but I figure if you set
$op = 'adminMain';
it should work |
_________________ - Only registered users can see links on this board! Get registered or login! -
Need help? Only registered users can see links on this board! Get registered or login! |
|
|
 |
Palbin

|
Posted:
Wed Jan 07, 2009 1:40 pm |
|
Well that would be the answer to why my admin.php would be blank after adding if (!isset($op)) $op = ''; to mainfileend.php.
if(!isset($op)) {
$op = 'adminMain';
That needs to be
if(empty($op)) {
$op = 'adminMain';
or maybe
if(!isset($op) || empty($op)) {
$op = 'adminMain'; |
|
|
|
 |
jestrella
Moderator

Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic
|
Posted:
Wed Jan 07, 2009 10:41 pm |
|
or maybe...
Code:$op = isset($op) ? $op : 'adminMain';
|
|
_________________ "For those whom have not reach the sky... Every mountain seems high"
Best Regards
Jonathan Estrella
http://about.me/jestrella04 |
|
|
 |
Palbin

|
Posted:
Wed Jan 07, 2009 11:29 pm |
|
jestrella wrote: | or maybe...
Code:$op = isset($op) ? $op : 'adminMain';
| |
You would have the same problem as now. When $op is initialized $op =''; the "catch all" would not catch all because it is set even though it is set to ''. So you need to use empty() as well. |
|
|
|
 |
montego

|
Posted:
Fri Jan 09, 2009 8:55 pm |
|
I like your
if(!isset($op) || empty($op)) {
$op = 'adminMain';
The best as it ensures no warning if $op isn't set. But, if you follow through the analysis and are certain that it will be set before mainfileend.php (doubtful in all cases), then, of course, you can go strictly with your "empty". |
|
|
|
 |
Palbin

|
Posted:
Fri Jan 09, 2009 9:30 pm |
|
I have proposed this in the mantis issue
if(!isset($op) || empty($op)) { |
|
|
|
 |
|