Hai there.
I’m working on a voting script.
I’ll just post a code first.
http://pastie.org/2014134 – php script
http://pastie.org/2014137 – jquery script (I’m just testing so it handles only “yes”)
As you can see at the end of php code there are a couple of print();s, and it returns to the browser, as declared in jQuery script. Now about the problem: it returns “You didn’t vote1dunno”. But the choice data in POST query equaled “yes”.
What the hell?
And also the php script just setting 3 for “yes”, 5 for “dunno” and 4 for “no” in database. What the hell?
Hai there. I’m working on a voting script. I’ll just post a code first.
Share
You have an error here:
if ($choice = 'yes') {(and well as in other two conditions).
You should not use assigment operator
=in your conditions but equality operator==:if ($choice == 'yes') {