-2
 <?php

    if(isset($_POST['poll'], $_POST['choice'])) 


{

    $poll = $_POST['poll'];

    $choice = $_POST['choice'];

    $voteQuery = $db->prepare("

        INSERT INTO polls_answers (user,poll, choice)
        SELECT :user, :poll, :choice
        FROM polls
        WHERE EXISTS (
        SELECT id
        FROM polls
        WHERE id = :poll



        ");
    $voteQuery->execute([
        'user' => $_SESSION['user_id'],
        'poll' => $poll,
        'choice' => $choice
        ]);
    header('Location:poll.php?poll='.$poll)
}

header('Location:plz.php');

?>

The Program is giving me an error with the last bracket. I don't know what is wrong with the code, everything is together.

Parse error: syntax error, unexpected '}'

Thank you for helping

Drudge Rajen
  • 6,477
  • 4
  • 20
  • 42
  • 2
    Possible duplicate of [PHP Parse/Syntax Errors; and How to solve them?](http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – Mr. Engineer Feb 18 '16 at 05:11

2 Answers2

3

please add ;

header('Location:poll.php?poll='.$poll);
naseeba c
  • 1,019
  • 2
  • 11
  • 30
1

You are missing a semicolon ; at line 30

header('Location:poll.php?poll='.$poll);
Drudge Rajen
  • 6,477
  • 4
  • 20
  • 42