Table Not Specified

Posted by Kris on Sat 04 Jan 2003 09:42 PM — 51 posts, 199,848 views.

USA #0
I got so close! I'm trying to install your forum code on my server, and have run into a brick wall. Although running under WinXP, my apache has PHP installed, and MYSQL is installed and functional as well.

I got as far as Section E of your INSTALL file: log on as administrator. I successfully logged on as administrator (after figuring out that the user/pass you listed there were literal), and then the install file said to change the admin password.

So I selected 'user' in the Edit Table dropdown field, and clicked the Edit button. Here's the page that came up:


We apologise that there has been a problem with the web server ...
Table name not specified

Error occurred at 2003-01-04 14:34:08

Please notify kris@aethia.org of the above message and time.


Unfortunately, that kris@aethia.org guy was no help at all :P I then experimented with different selections in the dropdown menu; all yielding the same error.

There was no mention of the problem in the INSTALL file, nor could I find any post about it, so here I am =) What would be causing that, and how would I go about fixing it?
Australia Forum Administrator #1
Since that was released PHP has changed the default way it processes variables passed to scripts. It sounds like the table name which should be passed down to the script is not there.

Try this. Edit the file common.php, and at the very end, add this line:

import_request_variables ("GPC");

USA #2
Awesome, that worked! I'll make a post if/when I get it working, including a few tips on getting it to work under Windows. :)
USA #3
Oops another problem!! When I clicked 'change'....

There is a problem ...
Primary key [id] is invalid [Field must be numeric]. You entered 'head'


USA #4
By the way, that occured when trying to change home_url. I didn't try it for any of the others yet.
Australia Forum Administrator #5
What table had you selected when that happened?
USA #6
I tried it with several different selections. It seems that I'm getting the error for all of them; not just home_url.
Australia Forum Administrator #7
You have to choose a table, which one did you choose? The control table should allow alpha keys, most others have numeric keys.
USA #8
Ok here's an example. I followed the instructions in INSTALL to the letter, as follows:

2. CHANGE the administrator password now!

a. Select "Edit table" : "user", then click on "Edit" button.
b. Click on "List All" button.
c. Click on "Administrator [1]".
d. Change the username from "Administrator" to your name (if you want).
e. Change the password by putting an "=" in front of it, eg.
Password: =swordfish
The password is hashed, when you visit the page again you will see it hashed.
f. Click on the "Change" button near the bottom of the page.


I did everything, changed username to "Kris", and changed the password to "swordfish" (just as a test; don't worry not my actual pwd hehe). I did not modify any other fields. I then clicked on the "change" button as instucted. Here's the page that came up:

There is a problem ...
Primary key [userid] is invalid [Field must be numeric]. You entered 'tail'


Page execution time: 0.013 seconds


Comments to: webmaster@your_site.com


None of the fields had 'tail' in them. I checked and re-checked every single step; I followed the instructions precisely.

The 'userid' key, as you know, is not one of the fields; it showed up as '1' on the form, and I couldn't change it if I wanted to. How should I fix this increasingly baffling problem?
Australia Forum Administrator #9
Ah, the light begins to dawn. :)

There is (was) a problem with editing the user table, which you are trying to do, because some of the fields clash with the userid which is established when you log on.

I can't reproduce that now, so maybe I fixed it. I'll zip up a version with my latest php files in it, and upload that, once I work out what they are. Give me a couple of hours, and I'll see what I can do.
Australia Forum Administrator #10
I think I have all the changes incorporated now. If you download the file below you should get a copy of the forum, including table editor, just as it works for me right now.


ftp://ftp.gammon.com.au/forum/forum_1.1.tgz
USA #11
I just tried it with the new forum script, and at the same point as before, I received the same error message when trying to change the administrator password and name:

There is a problem ...
Primary key [userid] is invalid [Field must be numeric]. You entered 'tail'


Page execution time: 0.018 seconds


I haven't a clue where to even begin to debug something like this hehe.
Australia Forum Administrator #12
Sounds like your version of PHP works a bit differently t o mine. Can you tell me what version it is? Is it on Windows? If you aren't sure, try making a small file like this:

<html>
<head>
<title>PHP info</title>
</head>
<body>
<?php
phpinfo();
?>
</body>
</html>


Save it as info.php, and execute it from your web browser.




Australia Forum Administrator #13
Also, do you only get that error editing the user table? What happens if you try to add/change a record in the control table?
USA #14
Here's my version of php: PHP Version 4.2.1

My apache webserver and mysql server are running under Windows XP Pro. Here's the version of Apache: Apache/1.3.20 (Win32) PHP/4.2.1

The error occurs when trying to edit other tables as well, however, the "you entered 'blah'" part is slightly different. For example, when trying to edit faq_url in the control table (didn't modify it; just accessed it and clicked the 'change' button):

There is a problem ...
Primary key [id] is invalid [Field must be numeric]. You entered 'head'


Page execution time: 0.004 seconds


In this instance, it was 'head', whereas when trying to change the administrator name/password it was 'tail'.
Australia Forum Administrator #15
Sounds close enough, the one on this web server is 4.2.3 (Apache 1.3.26), and on my personal PC is 4.1.2 (Apache 1.3.26) which also works.

Sounds like a problem passing arguments to PHP from the web page. "head" and "tail" are parts of the control record (head being the stuff at the top of each page, and tail being the stuff at the bottom), I don't know how those words go into the "id" field.

I'm not sure what to suggest here. I have that table editor (edittable.php) working on the web server here, on my OpenBSD web server at home, and on my web server running under Mac OS/X, all without any problems.

Dare I say, it is an XP problem? If you have a spare PC, try installing a version of Linux, FreeBSD, or OpenBSD. Personally I use OpenBSD but Mac OS/X seems to be based on FreeBSD.

You could try this ...

In edittable.php around line 992 are these lines:

/*

// debugging

DebugVars ();

ShowArray ("field", $field);
ShowArray ("field_max_len", $field_max_len);
ShowArray ("field_type", $field_type);

*/

Uncomment them by removing the /* and the */. Then try using it again. See what appears in the debugging display.
USA #16
I did just notice that I had the directory in the config files wrong; was set to the old forum directory (as opposed to the updated one you had me download). I made the appropriate corrections, but still the error occurs; now it's just slightly different. Instead of "you entered 'head'" it now says "you entered 'localhost'".

Here's the debug crap for the page where I edit faq_url in control:


HTTP_GET_VARS

[id] = [19]
[table] = [control]
HTTP_POST_VARS

HTTP_COOKIE_VARS

[session] = [cee2d3dfce91957046e13fb1449ca667]
[User] = [kris]
[Lang] = [en]
[Theme] = [Standard]
GLOBALS


Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_POST_VARS] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_POST] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_GET_VARS] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_GET] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_COOKIE_VARS] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_COOKIE] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_SERVER_VARS] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_SERVER] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_ENV_VARS] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_ENV] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_POST_FILES] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_FILES] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_REQUEST] = []
[CONFIG_PATH] = [C:/program files/webserver/server/apache/htdocs/fom1/forum2/forum/config/]
[WEBMASTER] = [kris@aethia.org]
[DATABASE_SERVER] = [localhost]
[GENERAL_DATABASE_NAME] = [forum2]
[GENERAL_DATABASE_USER] = [kris]
[MAIL_DATABASE_NAME] = [mail]
[MAIL_DATABASE_USER] = [nick]
[DUMP_TABLE_DIRECTORY] = [C:/program files/webserver/server/apache/htdocs/fom1/forum2/forum/sql/]
[INCLUDE_DIRECTORY] = [C:/program files/webserver/server/apache/htdocs/fom1/forum2/forum/include/]
[FORUM_INCLUDE_DIRECTORY] = [C:/program files/webserver/server/apache/htdocs/fom1/forum2/forum/forum_include/]
[ADMIN_DIRECTORY] = [C:/program files/webserver/server/apache/htdocs/fom1/forum2/forum/admin/]
[GENERAL_DATABASE_PASSWORD] = [(removed from debug)]
[MAIL_DATABASE_PASSWORD] = [secret]
[id] = [19]
[table] = [control]
[session] = [cee2d3dfce91957046e13fb1449ca667]
[User] = [kris]
[Lang] = [en]
[Theme] = [Standard]
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

.....
USA #17
(continued)

[userinfo] = []
[logoff] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[control] = []
[viewsource] = []
[PATH_TRANSLATED] = []
[pagestarttime] = [1042426473.9135]
[doingMail] = []
[current_database_name] = [forum2]
[foruminfo] = []
[blocked] = []
[adminaction] = []
[userid] = [1]
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[access] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[field] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[field_max_len] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[field_type] = []
[field_data] = []
[metatable] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[metarow] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[specials] = []
[primary_key] = [19]
[primary_key_name] = [id]
[display_field] = [item]
[action] = []

--------------------------------------------------------------------------------

field


Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[item] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[contents] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[id] = []
field_max_len

[item] = [30]
[contents] = [65535]
[id] = [11]
field_type

[item] = [string]
[contents] = [blob]
[id] = [int]



Then I click the 'change' button without modifying anything. Here's the error page with all the debug crap:

HTTP_GET_VARS

[id] = [19]
[table] = [control]
HTTP_POST_VARS

[item] = [faq_url]
[contents] = [/forum/bbshowpost.php?bbsection_id=1]
[searchfield] = [item]
[searchvalue] = []
[amend] = [Change]
[id] = [localhost]
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[table] = []
[simple] = []
HTTP_COOKIE_VARS

[session] = [cee2d3dfce91957046e13fb1449ca667]
[User] = [kris]
[Lang] = [en]
[Theme] = [Standard]
GLOBALS

....
USA #18
(continued)



Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_POST_VARS] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_POST] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_GET_VARS] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_GET] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_COOKIE_VARS] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_COOKIE] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_SERVER_VARS] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_SERVER] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_ENV_VARS] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_ENV] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[HTTP_POST_FILES] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_FILES] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[_REQUEST] = []
[CONFIG_PATH] = [C:/program files/webserver/server/apache/htdocs/fom1/forum2/forum/config/]
[WEBMASTER] = [kris@aethia.org]
[DATABASE_SERVER] = [localhost]
[GENERAL_DATABASE_NAME] = [forum2]
[GENERAL_DATABASE_USER] = [kris]
[MAIL_DATABASE_NAME] = [mail]
[MAIL_DATABASE_USER] = [nick]
[DUMP_TABLE_DIRECTORY] = [C:/program files/webserver/server/apache/htdocs/fom1/forum2/forum/sql/]
[INCLUDE_DIRECTORY] = [C:/program files/webserver/server/apache/htdocs/fom1/forum2/forum/include/]
[FORUM_INCLUDE_DIRECTORY] = [C:/program files/webserver/server/apache/htdocs/fom1/forum2/forum/forum_include/]
[ADMIN_DIRECTORY] = [C:/program files/webserver/server/apache/htdocs/fom1/forum2/forum/admin/]
[GENERAL_DATABASE_PASSWORD] = [(removed from debug)]
[MAIL_DATABASE_PASSWORD] = [secret]
[id] = [19]
[table] = [control]
[item] = [faq_url]
[contents] = [/forum/bbshowpost.php?bbsection_id=1]
[searchfield] = [item]
[searchvalue] = []
[amend] = [Change]
[simple] = []
[session] = [cee2d3dfce91957046e13fb1449ca667]
[User] = [kris]
[Lang] = [en]
[Theme] = [Standard]
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[userinfo] = []
[logoff] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

....
USA #19
(continued)


[control] = []
[viewsource] = []
[PATH_TRANSLATED] = []
[pagestarttime] = [1042427359.1774]
[doingMail] = []
[current_database_name] = [forum2]
[foruminfo] = []
[blocked] = []
[adminaction] = []
[userid] = [1]
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[access] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[field] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[field_max_len] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[field_type] = []
[field_data] = []
[metatable] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[metarow] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[specials] = []
[primary_key] = [19]
[primary_key_name] = [id]
[display_field] = [item]
[action] = [amend]

--------------------------------------------------------------------------------

field


Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[item] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[contents] = []
Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\program files\webserver\server\apache\htdocs\fom1\forum2\forum\include\common.php on line 527

[id] = []
field_max_len

[item] = [30]
[contents] = [65535]
[id] = [11]
field_type

[item] = [string]
[contents] = [blob]
[id] = [int]
There is a problem ...
Primary key [id] is invalid [Field must be numeric]. You entered 'localhost'


I took a look at common.php, since the errors were pointing to it, but unfortunately it was pretty much gibberish to me; my knowledge of php is very basic at best.

Dunno if that helps, but hopefully you'll find something wrong in there hehe :)
USA #20
I tried looking through common.php again today. However, I'm afraid to touch anything hehe. Do you think that repeated error pointing to common.php has anything to do with the id field getting screwed-up, and if so, any idea how I could fix it? :)
Australia Forum Administrator #21
Could be. I uncommented those lines and tried it, and did not get those warnings. Perhaps your PHP is configured differently in some way. I hesitate to guess in what way that might be.
USA #22
Strange.... Line 527 of common.php is (in bold):

printf ("<li>[%s] = [%s]\n",
htmlspecialchars ($cellname), // name
htmlspecialchars ($value)); // value


If $value is somehow corrupted here, that -could- perhaps explain the problem, assuming this printf statement has anything to do with assigning the 'id' value that seems to be messed up. Do you know what $value is supposed to be in this context, and what that statement is for?
USA #23
Ok ok I seriously doubt a printf statement in a section commented as 'debugging' could be the cause of the problem. Still, it might suggest some problem with passing the $value variable. Still don't understand why it would only be doing it on my server.... I don't see how something like that could be OS-related, and my version of php and apache are almost identical to yours (just slightly older i think).

This is indeed a puzzler.... I want to use the forum for the awards judges to use for the FoM event. It fits exactly what I need for it. If I could just get the bloody thing to work hehe....
Australia Forum Administrator #24
This is what I get, in part ...


HTTP_GET_VARS

HTTP_POST_VARS

[item] = [font] 
[contents] = [<FONT FACE=\"Verdana, Arial, Helvetica, Geneva\" size=-1>] 
[searchfield] = [item] 
[searchvalue] = [] 
[amend] = [Change] 
[id] = [3] 
[table] = [control] 
[session] = [c6acfcadab314c90084d1d529d7be71f] 
[simple] = [] 
HTTP_COOKIE_VARS

[session] = [] 


field

[item] = [Array] 
[contents] = [Array] 
[id] = [Array] 
field_max_len

[item] = [30] 
[contents] = [65535] 
[id] = [11] 
field_type

[item] = [string] 
[contents] = [blob] 
[id] = [int] 


This is quite different to your behaviour, so I think somehow PHP is behaving differently, why I cannot say. If you had Unix I would suggest giving me a shell account so I could take a look, but I don't see that working under XP.

As you can see above, when I try to change the field "font" in the "control" table (record 3) id is 3 (in HTTP_POST_VARS) whereas you don't have any HTTP_POST_VARS. I would try to find out why not. I notice you have them in _REQUEST, which leads me to the php.ini file. :)

Here is one suggestion that might work. Edit your php.ini file (better find where it is) and look for this line:


register_globals = Off


Change it to:


register_globals = On

USA #25
Whew! I just spent the last couple hours upgrading to the newest versions of Apache and PHP. Now using Apache 2.0.43 and PHP 4.3.0. It seems that Fate has a rather sick sense of humor, however, for now the problems seem even worse than before! I tested my configuration with other (albeit simpler) php scripts and it worked fine, so I know it's at least functional.

(with edittable.php's debugging turned off) I'm getting a whole bunch of PHP errors now. Here's logon.php after I login:

Notice: import_request_variables() [function.import-request-variables]: No prefix specified - possible security hazard in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 1471

Notice: Undefined index: session in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 145

Notice: Undefined index: session in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 147

Warning: Cannot modify header information - headers already sent by (output started at C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php:1471) in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 193

Notice: Undefined index: token in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 226

Notice: Undefined index: token in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 228

Notice: Undefined index: token in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 230

Notice: Undefined index: action in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 236

Your site name

--------------------------------------------------------------------------------

Logged on as Administrator
Notice: Uninitialized string offset: 0 in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 644

Notice: Uninitialized string offset: 0 in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 645

Notice: Undefined index: have_cookie_ok in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 646
(Menu)
Notice: Uninitialized string offset: 0 in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 644

Notice: Uninitialized string offset: 0 in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 645

Notice: Undefined index: have_cookie_ok in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 646
(Log off) (Forum)


--------------------------------------------------------------------------------

Administrator main menu

Notice: Uninitialized string offset: 0 in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 644

Notice: Uninitialized string offset: 0 in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 645

Notice: Undefined index: have_cookie_ok in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 646
Execute SQL command

Notice: Uninitialized string offset: 0 in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 644

Notice: Uninitialized string offset: 0 in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 645

Notice: Undefined index: have_cookie_ok in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 646
Execute SQL file
Edit table: accessbbbannedbbnotify_subjectbbnotify_topicbbpostbbsectionbbsubjectbbtopicbbusercontrolcountrymetarowmetatableuser
Notice: Undefined index: have_cookie_ok in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 704

Notice: Uninitialized string offset: 0 in C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2\forum\include\common.php on line 691


Page execution time: 0.014 seconds


Comments to: webmaster@your_site.com


Yikes! Furthermore, now when I try to click the 'edit' button, or in fact any of the links except for the mailto link, there is absolutely no effect. Nothing happens. I try opening one of those links in a new window; new window doesn't even pop up. Tried it in a few different browsers to be sure.

The same thing happened with the older versions I had today when I changed that register_globals thing (it was set to Off). I apparently changed it in the wrong file tho (php.ini-dist instead of pho.ini), which i think would have no effect, so it was probably something else I dunno (also since the problem was still there when I changed it back). In either case, at least we know the linking problem isn't related to the newer versions; I installed them after that problem occured in hopes of just starting everything fresh.

My detailed php configuration can be seen here:

http://www.aethiamud.org/php_config.php

As you can see, I went ahead and enabled the register_globals thing in this new configuration as well.

Perhaps you could look this over, and compare it with your own php configuration? If there's anything I should change, or just something you'd like me to try with the config, please lemme know. I'm sure that something in there could be changed to get this to work.... :)
Australia Forum Administrator #26
All these things are related to the same thing, PHP moved its "variable import" from HTTP_POST_VARS to _REQUEST recently, to fix various security issues. They hadn't done that when I wrote the code. For example, the error at line 145 is the line in bold below. I basically need to change references to HTTP_POST_VARS to _REQUEST throughout the code, and also *implied* references which will be harder than doing a "change all". Implied references are what the 'import_request_variables ("GPC");' is trying to do.

In other words, PHP used to take (say) $HTTP_POST_VARS ("id") and make it into a variable $id. Now it doesn't do that, and in addition you have to use $_REQUEST ("id") to get the same data.

I was hoping you could get the old behaviour by setting that option, but it seems not.

The 'fix' will be for me to go through each PHP file and change them to the new recommended behaviour. This will probably take a while to do and get rid of all the bugs (eg. missing one of the implied references).

As for the "extra" errors, you are now getting "notice" messages as well as errors and warnings. This accounts for the higher number. See this post:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=938

That describes the problem and solution.

Your web server seemed to stop while I was getting the config so I couldn't see the configuration. Can you fix that?


  global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;
  global $userinfo;

  $adminsession = $HTTP_POST_VARS ['session'];
  if (empty ($adminsession))
    $adminsession = $HTTP_GET_VARS ['session'];
  if (empty ($adminsession))
    $adminsession = $HTTP_COOKIE_VARS ['session'];

Australia Forum Administrator #27
It seemed to work that time. Your options look similar to mine, bearing in mind I have a different version.
USA #28
Ok I fixed the problem with the 'notice' errors, tho the sudden, mysterious problem with the php links is still there. I think I know -why- it's not doing anything now when I click on one of the forum links; cuz for whatever reason, the php is generating an a href to the file's location on my hard drive rather than on my webserver (i.e. "a href=c:/blahblahblah.php"). In my config files I had no choice but to put the direct (i.e. not relative) file locations on my hdd; everything else, from variations on relative locations to direct urls to the files on my webserver, generated errors about the files not being found.

Dunno what the fix is there, but obviously it would have something to do with having the links point to the files on my webserver and not on my hard drive itself.
Australia Forum Administrator #29
The forum URL is one of the control records, ie.

$FORUM_URL = $control ['forum_url'] . '/';


In other words, the item "forum_url" in the control table. In my case (this forum) it is:

http://www.gammon.com.au/forum

USA #30
Ok that clears up a bit of the mystery with that anyways. How would I go about fixing forum_url to point to "http://www.aethiamud.org/fom1/forum2b/forum"? Right now it seems to be pointing to "C:\program files\webserver\server\apache\apache2\htdocs\fom1\forum2b\forum" instead, or just a relative '/' which makes it assume the hdd location instead of the url location.

How would I fix this?
Australia Forum Administrator #31
You change that entry in the control table. Once we fix the problem with updating database records in general that should be easy. As for your other problem it would help if I could reproduce it, which I'll try to do when I get back from holidays, but meanwhile, try this. Currently in the common.php file is the following code, commented out:


reset ($HTTP_GET_VARS);
while (list ($name, $value) = each ($HTTP_GET_VARS))
    $HTTP_GET_VARS [$name] = addslashes ($HTTP_GET_VARS [$name]);

reset ($HTTP_POST_VARS);
while (list ($name, $value) = each ($HTTP_POST_VARS))
    $HTTP_POST_VARS [$name] = addslashes ($HTTP_POST_VARS [$name]);

reset ($HTTP_COOKIE_VARS);
while (list ($name, $value) = each ($HTTP_COOKIE_VARS))
    $HTTP_COOKIE_VARS [$name] = addslashes ($HTTP_COOKIE_VARS [$name]);

extract ($HTTP_GET_VARS, EXTR_OVERWRITE);
extract ($HTTP_POST_VARS, EXTR_OVERWRITE);
extract ($HTTP_COOKIE_VARS, EXTR_OVERWRITE);


What might work would be to do a variation of that to get the data from the _REQUEST variable into normal variables. Edit the line in common.php that reads:


import_request_variables ("GPC");


and replace it with:


reset ($_REQUEST);
while (list ($name, $value) = each ($_REQUEST))
    $_REQUEST [$name] = addslashes ($_REQUEST [$name]);

extract ($_REQUEST, EXTR_OVERWRITE);
$HTTP_GET_VARS = $_REQUEST;
$HTTP_POST_VARS = $_REQUEST;


I haven't tested that, but it might work. :)
Amended on Sat 18 Jan 2003 10:42 PM by Nick Gammon
USA #32
Hmm had no effect. The links are still pointing to files at C:/ instead of aethiamud.org/
USA #33
I'll admit my general lack of knowledge on this one, but would it be possible to alias C:\ to the mudroot and trick the forum code into looking at the proper directory?
Australia Forum Administrator #34
I am doubting you are successfully changing the control record, as that should work. Please use the "execute SQL command" link, or some other method, to execute this SQL statement, and post the result or at least the entry for forum_url.

SELECT * FROM control ORDER BY item
USA #35
I can't use the "execute sql command" link. Like I said, it has absolutely no effect; the url the link points to is:

file:///C:/program files/webserver/server/Apache/Apache2/htdocs/fom1/forum2b/forum/admin/executesql.php

That's the problem. I tried editing common.php manually by replacing that line you stated with that chunk of code, but it had no effect.
Australia Forum Administrator #36
Something is odd here. For one thing, HTTP_POST_VARS should now have stuff in. Those debug lines should confirm that. The problem with the link being wrong in the control record will be why the hyperlinks don't work.

If you have mySQL operating you should have mysql client program. You can use that to do the "select" I suggested and even change things from the mysql client. Have you tried using it?
USA #37
This is the Windows version of Mysql. Not quite what you mean by "select". There's a bunch of files, but basically the only 2 I actually know what to do with are mysql.exe and winmysqladmin.exe. Is 'select' a parameter of mysql.exe or something? The 'winmysqladmin.exe' is pretty useless; I was able to create the forum database, but I had to shell into DOS and use the manual command-line call to mysql.exe to actually import the data.

Do ya know the equivalent of what you're talking about with the Windows version?
Australia Forum Administrator #38
If you have a mysql.exe then that should be the mySQL client program. You would start it up something like this:


 mysql -ukris -pswordfish forum
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 3.23.53

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> 


The above should connect you to database "forum" for user "kris" password "swordfish".

Then do the select:


mysql>  SELECT * FROM control ORDER BY item; 
+---------------------------+----------+----+
| item                      | contents | id |
+---------------------------+----------+----+
| allow_deletes             | 1        |  6 |
| allow_edits               | 1        |  5 |
| allow_messages            | 1        | 25 |
| allow_notification        | 1        | 24 |
| allow_posts               | 1        |  4 |
| allow_registrations       | 1        |  7 |
| amend_post_date           | 0        | 18 |
| extended_dates            | 1        | 29 |
| forum_version             | 1        | 23 |
| minuteswest               | 0        | 31 |
| post_under_different_name | 0        | 20 |
+---------------------------+----------+----+



You should see more entries than this, but this is the general idea.
USA #39
Here's the entry for forum_url:

item | contents | id

forum_url | http://www.your_site.com/forum | 15

Australia Forum Administrator #40
The directory for those links is $ADMIN_DIRECTORY, which is configured in general_config.php, like this:


// where the admin stuff is (relative to the web browser)

$ADMIN_DIRECTORY = "/admin/";


I did a grep to find references to it ...


executesqlfile.php:<h1>Execute SQL commands in a file</h1>
index.php:    hLink ("Execute SQL command", $ADMIN_DIRECTORY . "executesql.php");
index.php:    hLink ("Execute SQL file", $ADMIN_DIRECTORY . "executesqlfile.php");
logon.php:    hLink ("Execute SQL command", $ADMIN_DIRECTORY . "executesql.php");
logon.php:    hLink ("Execute SQL file", $ADMIN_DIRECTORY . "executesqlfile.php");


I suspect all this is related to the _REQUEST issue, as it would appear that $ADMIN_DIRECTORY is not being processed - or have you set it to something else?

Put it another way, what is the line for $ADMIN_DIRECTORY in your general_config.php exactly?
Amended on Sun 26 Jan 2003 10:37 PM by Nick Gammon
USA #41
That's what it was. With 'admin directory', like the others, I had it pointing at the C:\ location of the directory instead of the http location or relative location. With the others (like 'include directory' for example) only the direct C:\ location would work; I assumed the same for the admin one as well.

Now changing it seems to be working fine (finally!). :)


If all goes well, I'll post a detailed subject with Windows-specific installation instructions, since there are a few very notable differences hehe. Thanks fer the help; I'll let ya know if I run into another brick wall :)
Australia Forum Administrator #42
The comment above "(relative to the web browser)" meant that the entry was supposed to be where your web browser looked for it, not what the location on disk was.
USA #43
Ahh i c. Everything seems to be working ok now, 'cept I have run into 1 bug. When attempting to change my user profile, I click 'save', and this error comes up:

Forum user details
There is a problem ...
Update failed: Unknown column 'htmlpost' in 'field list'



I'm assuming that's from the "Post in HTML?" field? What should I do to fix that?
Australia Forum Administrator #44
Did you re-import the database when you got the updated version? I went through and added the extra fields to the tables that the up-to-date version requires, at least I thought I did. :)

Use mysql to "drop database forum" and then re-import as per the installation instructions. Hope you haven't changed much so far.
USA #45
When I downloaded the new version, I put it in a seperate directory and created a seperate database name for it. When I imported it, I imported from the sql of the new version.
Australia Forum Administrator #46
Hmm - looks like I overlooked that one.

Use mysql command-line (or the Execute SQL feature) to do these two commands:

alter table bbuser add htmlpost tinyint;

alter table bbuser add unlimited_post_length tinyint;
USA #47
Yup that worked. When I tried the second one, it beeped at me and gave the error "ERROR 1060: Duplicate column name 'unlimited_post_length'". I'm guessing that just means that entry was already there.... So yah it's working now. :)
USA #48
There is one minor thing I can't seem to figure out. I left minuteswest set to 0, and it was tagging things in UTC. I want it to be in Pacific time, so I changed minuteswest to -8. However, it had absolutely no effect. It seems that regardless of the minuteswest value, the posts I made are still showing up in UTC.
Australia Forum Administrator #49
You are not 8 minutes east of London - I shouldn't think. Try multiplying by 60 to get hours.
Amended on Wed 29 Jan 2003 02:00 AM by Nick Gammon
USA #50
Oh lol my bad; I was thinking in hours. It's working now hehe :)