XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).
Moderator: General Moderators
iG9
Forum Commoner
Posts: 38 Joined: Fri Jul 18, 2008 2:11 pm
Post
by iG9 » Thu Nov 13, 2008 5:02 pm
So I'm processing a registration form, and if there's a problem I'm passing back what they entered so they don't have to retype it. so the URL looks like ...register.php?variable1=value1&variable2=value2 and so on. The problem comes when the user puts a '#' in their address. when it gets passed back it and all the variables after it get ignored. I think they're seen as a comment. So for example
Code: Select all
register.php?emailEntered=test@test.com&password=1&fnameEntered=John&lnameEntered=Smith&addr1Entered=100%201st%20St%20#3&addr2Entered=&cityEntered=Beverly Hills&stateEntered=CA&zipEntered=90210 is only being seen as
Code: Select all
register.php?emailEntered=test@test.com&password=1&fnameEntered=John&lnameEntered=Smith&addr1Entered=100%201st%20St%20# by the page and the later fields aren't repopulating even though I see them in the URL. Any ideas how to pass back the # safely? Thanks.
VladSun
DevNet Master
Posts: 4313 Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria
Post
by VladSun » Thu Nov 13, 2008 5:32 pm
There are 10 types of people in this world, those who understand binary and those who don't
iG9
Forum Commoner
Posts: 38 Joined: Fri Jul 18, 2008 2:11 pm
Post
by iG9 » Thu Nov 13, 2008 8:34 pm
Thanks man I'll give it a try.
iG9
Forum Commoner
Posts: 38 Joined: Fri Jul 18, 2008 2:11 pm
Post
by iG9 » Fri Nov 14, 2008 5:43 pm
Got it working. I used urlencode() on the processing page and
Code: Select all
parse_str(urldecode($_SERVER['QUERY_STRING']));
on the registration page. Then I had to change the logic from hanging on
to just
The parse_str() man page had a comment to the effect that it would do an urldecode automatically but I didn't find that to be the case. Anyway thanks.