P
P
Pavel Shimansky2012-01-13 20:02:11
PHP
Pavel Shimansky, 2012-01-13 20:02:11

Voting problems

The situation is this. There is index.php, two pictures appear on it and a person votes for one of them. The problem is that when voting for the second photo, the first one still wins. What to do?

rate.php (responsible for adding and subtracting votes) jsfiddle.net/Rg7vf/
index.php jsfiddle.net/ad3PM/1/

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Desiderata, 2012-01-13
@shimapa23

I guess it should be like this .

A
Alexey, 2012-01-13
@Sterhel

In your first photo, the EP poster is simple along the way.

D
ddenisyuk, 2012-01-13
@ddenisyuk

if ($_POST['winner'] == $_POST['first']){
$looser = $_POST['second'];
} else {
$looser = $_POST['second'];

Something tells me that the error is somewhere here.

I
Ilya Plotnikov, 2012-01-13
@ilyaplot

Have you decided to follow in the footsteps of Mark Zuckenberg?
It seems to me that it is better to make 2 forms with input hidden and the same names of these fields. Then one value will come - the id of the image.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question