Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ Forum software ➜ Installation ➜ warnings on Windows NT4.0

warnings on Windows NT4.0

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Wuliao   (14 posts)  Bio
Date Mon 18 Feb 2002 04:55 AM (UTC)
Message
Nick,

I tried to install the forum on my home PC, which is running windows NT4.0 server. I almost got everything setup by following the instructions in the install.txt.

But when I pull up the logon.php, I got a full page of warnings. I just wonder if you have any quick suggestion how can I turn it off.

The IE version I was using is 5.5. The web server is running on MS IIS server 4.0.

The warnings messages are

Warning: Undefined index: session in D:\forum\include\common.php on line 204

Warning: Undefined index: session in D:\forum\include\common.php on line 206

Warning: Undefined index: session in D:\forum\include\common.php on line 208

Warning: Undefined index: adminaction in D:\forum\include\common.php on line 214

Warning: Undefined index: username in D:\forum\include\common.php on line 215

Warning: Undefined index: password in D:\forum\include\common.php on line 216

Warning: Undefined index: token in D:\forum\include\common.php on line 285

Warning: Undefined index: token in D:\forum\include\common.php on line 287

Warning: Undefined index: token in D:\forum\include\common.php on line 289

Warning: Undefined index: action in D:\forum\include\common.php on line 295

Warning: Undefined index: username in D:\forum\include\common.php on line 298

Warning: Undefined index: password in D:\forum\include\common.php on line 302

Thanks for any insight in advance.

Wuliao
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 18 Feb 2002 05:51 AM (UTC)
Message
I presume the first warning is from this line:


$adminsession = $HTTP_POST_VARS ['session'];


I guess this is caused by the variable 'session' not being recognised as part of the POST variables. Why, I am not sure, as I would have thought that such variables could be unsupplied.

Which version of PHP are you using? Perhaps it is either:


  • Out of date, in which case you need to upgrade; or
  • Very recent, giving warnings that I don't get.


Apart from the warnings, does it work as expected? If so, it might just be a warning level that needs tweaking.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Wuliao   (14 posts)  Bio
Date Reply #2 on Mon 18 Feb 2002 06:01 AM (UTC)
Message
After some research, it looks like to me that PHP got updated, and the warning message are new.

Anyway, here is the change I made to make the warnings disappear in the common.php

if (array_key_exists("session", $HTTP_POST_VARS))
$adminsession = $HTTP_POST_VARS ["session"];
if (empty ($adminsession) && array_key_exists("session", $HTTP_GET_VARS))
$adminsession = $HTTP_GET_VARS ["session"];
if (empty ($adminsession) && array_key_exists("session", $HTTP_COOKIE_VARS))
$adminsession = $HTTP_COOKIE_VARS ["session"];


The check on array_key_exists will make the warnings gone.

Thanks
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 18 Feb 2002 07:45 AM (UTC)
Message
Sounds a bit wordy. You could change the error reporting level.

From the PHP web documentation:


E_NOTICE
Notices are not printed by default, and indicate that the script encountered something that could indicate an error, but could also happen in the normal course of running a script. For example, trying to access the value of a variable which has not been set, or calling stat() on a file that doesn't exist.


Also a comment:


"Default php.ini does NOT set to display E_NOTICE messages. For several reasons, programmers are better to work with NOTICE messages while developing PHP application."


Sounds like you have it set somehow.

You could find the php.ini file and try to set it to not display E_NOTICE, which should make the warnings go away.

Alternatively, change the error reporting level like this:


error_reporting(E_ALL & ~(E_NOTICE));




- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Wuliao   (14 posts)  Bio
Date Reply #4 on Tue 19 Feb 2002 05:45 AM (UTC)
Message
I put the line in the common.php, and it works nicely.

And the forum also works fine after I configure the forum.

Thanks very much, nick.
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #5 on Tue 19 Feb 2002 06:19 AM (UTC)

Amended on Tue 19 Feb 2002 06:20 AM (UTC) by Nick Gammon

Message
Let me know the URL when you have it going so I can try it. :)

There is a slightly more up-to-date version available, for instance the later one shows the number of views at the main (top) level, and at the summary per section (see this forum for an example).

Let me know if you would like a copy.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Wuliao   (14 posts)  Bio
Date Reply #6 on Thu 21 Feb 2002 04:47 AM (UTC)
Message
I would like you to visit it if I could. The problem is machine only use telephone dialup, and did not have a fix IP. It is a really home PC.

For the time being, I am quite satisfied with the forum. I will see if I want try the newer one after I get used to this version.

Thanks a lot.
Top

Posted by Wuliao   (14 posts)  Bio
Date Reply #7 on Thu 21 Feb 2002 06:12 AM (UTC)
Message
It seems like to me the forum is not compatible with international language support, in particular support of chinese.

But if I change all the htmlentity function calls to htmlspecialchars function calls it then works fine.
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #8 on Thu 21 Feb 2002 09:57 AM (UTC)
Message
It is interesting that you have this problem. Looking at the description for those functions on the PHP site ...


htmlspecialchars

Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings. This function returns a string with some of these conversions made; the translations made are those most useful for everyday web programming. If you require all HTML character entities to be translated, use htmlentities() instead.



Judging by the above htmlentities does "more" which is why I use it, however if htmlspecialchars works better for you then by all means use it. Perhaps I should switch too, however it is a bit unclear as to which one is really "better".


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


32,188 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.