Allora il config.php
codice:
<?PHP
function display_error($error_text)
{
print 'Error:
'.$error_text.'</P>';
exit;
}
if (!isset ($poll_id))
{
display_error('Please set the poll id.');
}
if (!isset ($root_path))
{
$root_path = './';
}
$fp = @fopen($root_path . 'data/data_' . $poll_id . '.csv','r');
if (!$fp)
{
display_error('Unable to open file: data_'.$poll_id.'.csv');
exit;
}
$vote_options = fgetcsv ($fp, 1000, ','); // Put csv file into an array
fclose ($fp);
$fp2 = @fopen($root_path . 'data/vote_' . $poll_id . '.csv','r');
if (!$fp2)
{
display_error('Unable to open file: vote_'.$poll_id.'.csv');
exit;
}
$vote_data = fgetcsv ($fp2, 1000, ',');
fclose ($fp2);
// Misc options
$csv_entry = count($vote_options);
$n = $csv_entry - 4;
$debate = $n + 1;
$poll_info = '';
?>
Ho messo tutti i file in uno zip (save as..):
http://aaogisclan.altervista.org/poll.zip
e questo è il risultato:
http://aaogisclan.altervista.org/index3.php