Basil Fawlty
Journeyman
Registered: 10/30/01
Posts: 133
Loc: New Mexico
I'm trying to build an integrated page that requires input from the user via a forum. The variable in the form gets passed to the "script" file ok, but the space between words gets removed, so, for example, "Austin Healey" (a selection from a drop down on my form) becomes: "AustinHealey". Any idea why this happens and is there anything I can do about it?
Micky
Member
Registered: 02/11/04
Posts: 183
Loc: Bern, Switzerland
Hi, tries sometimes these two lines from header.tpl out increase.
Quote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir="{$lang.READ_DIRECTION}">
Basil Fawlty
Journeyman
Registered: 10/30/01
Posts: 133
Loc: New Mexico
Originally Posted By: chillin
is your form using POST or GET? Maybe the variable isn't being encoded properly.
It looks like this:
Php Code:
"input" => array(
// This is an array of variables that you expect from the user
// "varname" => array("fieldname","requesttype","vartype");
// requesttype can be either "get", "post" or "both"
// vartype can be "int", "alpha", "alphanum" or just blank if it can contain any characters
"var1" => array("var1","post","alpha"),
Where var1 is the variable name that gets past via the form input. If the selection on the form is, for example, "Michael Jordan" then that gets passed in the var1 variable, but when it gets to the script file, (.inc.php) it looses the space and becomes "MichaelJordan"
Basil Fawlty
Journeyman
Registered: 10/30/01
Posts: 133
Loc: New Mexico
YES!!! That did it! Thanks! I guess the answer was right there in front of my face the whole time: "or just blank if it can contain any characters" and somehow I just zoned that out.
chillin
Journeyman
Registered: 01/26/03
Posts: 127
Loc: bend, OR USA
we've all been there. i for the life of me couldn't figure out why a file upload form I made wasn't working, when after 30 mins I realized that i had my form encoding wrong.