PDA

View Full Version : A webserver problem



the-mk
08-31-2003, 03:01 PM
Hi!

Today I installed a Mandrake Linux 9.1 on an old empty harddisk. I installed it with a webserver (Apache), database (MySQL) and other servers (Samba).

My main problem is the webserver. It's the "Apache-AdvancedExtranetServer/2.0.44 (Mandrake Linux/11mdk) mod_perl/1.99_08 Perl/v5.8.0 mod_ssl/2.0.44 OpenSSL/0.9.7a PHP/4.3.1". I left every configuration file like Mandrake installed it...

I wanted to put my TKC-stats onto the server (PHP) and only the main page is working correct (index.php). All the other linked pages like user.php?user=THE-MK do not work because the $user-variable in the user.php-script has nothing in it (NULL).
:trash:
And I installed one of the latest versions of phpMyAdmin to administrate the MySQL-database. And there are the links and all the sites working correct, so I was able to set up the DB for TKC.
:crazy:
The whole TKC-stats were working correctly on my good old SuSE-server version 8.0 Professional (Apache/1.3.23 (Unix) PHP/4.1.0)...

Are there some tricks that my php-scripts are working correct?

If you have questions about anything, ask!

Every help is appreciated!

Dyyryath
09-01-2003, 01:03 AM
You need to change the variable $user in your scripts to $_GET["user"] (or $_POST["user"] as the case may be). It's a security thing with the latest versions of PHP.

Previously, register_globals was set to 'on', which provided the variable with same name as any GET or POST parameter. However, this is also a security problem. Smart users can inject poisonous variables into poorly written code, allowing them to do things they shouldn't be able to do. If I remember correctly, this was changed in 4.2.0. You can still set register_globals = ON in your php.ini file, but it's not a good idea. Use the $_GET and $_POST arrays instead.

Hope that helps. ;)

the-mk
09-01-2003, 11:10 AM
Master Dyyryath! You helped me a lot! That $_GET["user"] works fine!

Give him a virtual :cheers: from IB's fridge! :D

Thanks a lot!

:notworthy Dyyryath :notworthy