开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜