Jump to content

help with voting system???


mattm1712

Recommended Posts

<form action='index.php'  method='POST'  enctype='multipart/form-dat'>

 

<select name='votes'>

  <option>SEATOWN</option>

<option>vote1</option>

<option>vote2</option>

<option>vote3</option>

</select>

<input type='submit' name='vote' value='Vote'>

</form>

<?php

 

$vote=$_GET['votes'];

if(isset($_POST['vote']))

{

echo "voted";

echo $vote;

}

 

 

?>

 

why would this not echo out anything for $vote???

 

 

cheers matt

Link to comment
https://forums.phpfreaks.com/topic/250636-help-with-voting-system/
Share on other sites

You need to change the following lines

 

$vote = $_GET['votes'];

if(isset($_POST['vote'])){

    echo "voted";

    echo $vote;

}

 

to

 

if(isset($_POST['votes'])){

    $vote = $_POST['votes'];

    echo "Voted : " . $vote;

}

 

Haven't tested this but is should work

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.