Question mark in print_r array key
I have a small form for setting event reminders. Couple check boxes and some date times. Nothing fancy. One field in particular is getting passed into php with something funky:
<input type="checkbox" name="smsGetReminder" value="1" checked />
<input type="checkbox" name="smsGetUpdates" value="1" checked />
Pretty basic right? 2 check boxes checked by default. Now when they get posted (send as $_GET) a question mark magically appears in front of smsGetUpdates so that it looks like this:
Array (
[?smsGetBlast] => 1
[smsGetReminder] => 1
[dp1] => 06/18/2011
[rHrs] => 07
[rMins] => 00
[rAmpm] => PM
[smsPhone] => 1234567890 开发者_如何转开发
[getEmail] => 1 [f] => p
)
Where is that question mark coming from? When I extract $_GET everything works as expected except that one. The validation portion tells me $smsGetBlast doesn't exist because obviously it has a question mark there.
Any help would be much appreciated.
~~~~SOLVED~~~~
I had accidentally put a ? in my ajax data string. The jquery documentation led me to believe it was needed when it was not.
You have probably inadvertently inserted a "strange" character into the name
attribute of the smsGetBlast
input element (Which is missing in the question, nudge nudge).
My crystal ball tells me that you inadvertently inserted fancy quotes instead of "
after name=
in that element.
精彩评论