|
Joined: Oct 2001
Posts: 139
Journeyman
|
Journeyman
Joined: Oct 2001
Posts: 139 |
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?
Thanks, Basil
|
|
|
|
Joined: Jan 2003
Posts: 125
Journeyman
|
Journeyman
Joined: Jan 2003
Posts: 125 |
is your form using POST or GET? Maybe the variable isn't being encoded properly.
|
|
|
|
Joined: Oct 2001
Posts: 139
Journeyman
|
Journeyman
Joined: Oct 2001
Posts: 139 |
Like this: <FORM ACTION="ubbthreads.php?ubb=mypage" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded">
|
|
|
|
Joined: Jan 2003
Posts: 125
Journeyman
|
Journeyman
Joined: Jan 2003
Posts: 125 |
And what does your input array look like on mypage.inc.php... maybe you have the resulting field being mapped incorectly?
|
|
|
|
Joined: Feb 2004
Posts: 182
Member
|
Member
Joined: Feb 2004
Posts: 182 |
Hi, tries sometimes these two lines from header.tpl out increase.
|
|
|
|
Joined: Oct 2001
Posts: 139
Journeyman
|
Journeyman
Joined: Oct 2001
Posts: 139 |
is your form using POST or GET? Maybe the variable isn't being encoded properly. It looks like this: "input" => array( "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"
|
|
|
|
Joined: Jan 2003
Posts: 125
Journeyman
|
Journeyman
Joined: Jan 2003
Posts: 125 |
Thats whats stripping the spaces from your variable change your var input to "var1" => array("var1","post",""), and the preg_replace function that is stripping your spaces won't mess with your variable anymore!
|
|
|
|
Joined: Oct 2001
Posts: 139
Journeyman
|
Journeyman
Joined: Oct 2001
Posts: 139 |
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.
Basil
|
|
|
|
Joined: Jan 2003
Posts: 125
Journeyman
|
Journeyman
Joined: Jan 2003
Posts: 125 |
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.
|
|
|
|
Joined: Oct 2001
Posts: 139
Journeyman
|
Journeyman
Joined: Oct 2001
Posts: 139 |
Yeah, sometimes the simplest problems can take the longest to figure out because your not looking for the obvious!
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
lol, its all new though, so at least its understandable
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 254
Joined: January 2000
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|