passed vars (php) and non-English forum

Problems with the Windows version of XAMPP, questions, comments, and anything related.

passed vars (php) and non-English forum

Postby ElfN » 25. December 2010 01:13

I have two problems. The first is a minor irritation and I'm sure I did it to myself. <sigh> When I sign in, I end up on a non-english version of the forum. Don't ask me how I managed signing myself up to something in a language that vaguely resembles German, but there you go, that's what I've managed to do. Any idea on how to redirect my redirect to the English version?

Second, I'm having trouble with passed vars. It's the Slippery Critters thing again . . . and before you start yelling about my coding, it works fine online ( It doesn't work fine in the integrated browser in my editor, nor does it work fine when I go directly to the local file (http://localhost/SlipperyCritters/index.php?inc=3) in my main (Firefox) browser.

I test for $inc and as far as the scripting is concerned, the variable has not been set. Is there something in the php.ini or in the my.ini that should be set differently than what is standard? I can set and print_r a multidimensional array, no problem, but when I'm trying to pass a var in the url, the var acts as if it's never been set. Ideas? Directions to look in? Any kind of help at all?


Posts: 19
Joined: 06. May 2009 20:14

Re: passed vars (php) and non-English forum

Postby Nobbie » 25. December 2010 01:50

Posts: 10611
Joined: 09. March 2008 13:04

Re: passed vars (php) and non-English forum

Postby Altrea » 25. December 2010 10:35

It's a really really bad practice to use register_globals, because it tempt beginner scripter to build security issues in their scripts.
EVERY variable you havend initialized first can be manipulated in the URLvif register_globals is set to on!

If you want to pass variables by URL, use something like this:
Code: Select all
//e.g. url: http://localhost/SlipperyCritters/index.php?inc=3
if( !empty( $_GET['inc'] ) ) {
    // make a local variable out of the superglobal array key
    $inc = $_GET['inc'];

    // here you should validate and sanitize your variable !!!
    // don't use variables you don't sanitized first !!!

So: Every variable you pass by URL can be find in the superglobal $_GET Array.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
AF Moderator
Posts: 9357
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: passed vars (php) and non-English forum

Postby ElfN » 25. December 2010 15:16

register_globals is the answer I needed.

Any thoughts on why I go from my login screen to a non-English forum?
Posts: 19
Joined: 06. May 2009 20:14

Re: passed vars (php) and non-English forum

Postby JonB » 26. December 2010 16:09

Please tell is how in the world we should know this answer, when you have not mentioned the script name?

Wait, I read your last reply, it has all the info I need


User avatar
AF Moderator
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 40 guests