<form action="newsletter" method="POST">
                        <div class="input-group">
                          <input type="email" class="form-control box-style-1" size="50" name="email" placeholder="Your email" required>
                          <input type="hidden" name="code" value="<?php echo $code; ?>" >
                          <div class="input-group-btn">
                            <button type="submit" class="btn subscribe-btn">Subscribe</button>
                          </div>
                        </div>
                     </form>
I have tried to send a hidden code (randomly generated) through form but i am not able to prevent the spam.