Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5985891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:35:42+00:00 2026-05-22T22:35:42+00:00

Hai there. I’m working on a voting script. I’ll just post a code first.

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:35:43+00:00Added an answer on May 22, 2026 at 10:35 pm

    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') {

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hai Is there any way to edit the Registry of an system from another
Hai guys, Is there any google api for Internationalization with asp.net or any other
Hai guys, Is there any alternative for windows scheduler for an asp.net application... The
Hai I am doing a web page. In that there is a drop down
Hai Guys, Like DataAccessApplicationBlock for .net with sql server,Is there any thing for MySql
Hai guys, Error div is placed under menu div when there is no runat=server....
Hai. I was making this simple string class and was wondering if there was
hai every one . im my project while displaying a page if there are
Hai Friends, I want to display a toast message to the user, when there
Hai I am using the following code to access columns in a row but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.