If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
Messages posted by: maurice
Forum Index » Profile for maurice » Messages posted by maurice
Author Message
I did experience the same problem.

So I did write some code to create a survey of several polls and in the end display the results.
Save this as a file (for example survey.php) in the root path of the poll scripts.
Change the paths in the file for the include_once to your own paths.


<?php
// Important! You have to include it before your html code
include_once "/poll/poll_cookie.php";
?>

<html>
<body>
<?php
include_once "/poll/booth.php";

// Determine the poll ID's to use in this survey
$poll_start_id=4; //The first poll ID to start
$poll_end_id=9; //The last poll ID to include


// Set Variables for the poll class
$php_poll->set_template_set("plain");
$php_poll->set_max_bar_length(125);
$php_poll->set_max_bar_height(10);


// Determine if the form is allready posted and determine the poll ID
if (!isset($_POST['poll_ident'])) {
// Not posted yet so start with the first ID
$poll=$poll_start_id;
}
else {
// Posted, so process the poll and add 1 to the poll ID
$php_poll->poll_process($_POST['poll_ident']);
$poll=$_POST['poll_ident']+1;
}

// Determine if a new poll has to be shown
if ($poll<=$poll_end_id) {
// While the last ID is not reached yet show the next poll
echo "Variabele: ".$_POST['poll_ident'];
echo $php_poll->poll_process($poll);
}
elseif ($poll==$poll_comment_id) {

}
else {
// If the last poll is reached then show the results
for ( $counter = $poll_start_id; $counter <= $poll_end_id; $counter += 1) {
echo $php_poll->view_poll_result($counter);
}
}



?>
</body>
</html>
 
Forum Index » Profile for maurice » Messages posted by maurice
Go to:   
Based on the open source JForum