php poll form, please help me out!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sarahc
Forum Newbie
Posts: 1
Joined: Thu Sep 20, 2007 10:29 am

php poll form, please help me out!!!

Post by sarahc »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello forum,
I'm new to this forum and a total newbie in php programming.

I have this php code to make a survey on our website. only I would like to know how to add more questions to it and have only one SUBMIT button. At the moment, as you can see on our page, I have to call 2 polls to have 2 questions appear and therefore have 2 SUBMIT buttons ( http://www.fauna-flora.org/pollffi.php )

The code in my configuration page is the following:

I would very much appreciate any help on how to add more questions to the same poll... 
Thanks a lot for your patience,

Sarah.

Code: Select all

<?php
require_once(dirname(__FILE__) . '/class.php');
$POLL_URL = 'poll/';
$POLL_ID_PARAM_NAME = "pollid";
$VOTE_PARAM_NAME = "vote";
$MAX_POLL_BAR_WIDTH = 200;

$SUBMIT_BUTTON_STRING = 'Submit';
$NUMBER_OF_VOTES_STRING = 'Total votes: %s';
$VOTE_STRING = 'Vote:';						
$VOTE_LIST_DEFAULT_LABEL = 'Please Select';	
$VIEW_RESULTS_STRING = 'Current Results';
$DUPLICATE_VOTE_ERROR_MSG = 'You have already voted!';
$NO_VOTE_SELECTED_ERROR_MSG = 'You forgot to select a value!';

$VALID_POLLS = array();	

$p = new Poll;
$p->question = "We try to keep our pages short and focused so they are easy to read. What do you think of the length of our pages?";	
$p->returnToURL = "http://www.fauna-flora.org/pollffi.php";				
$p->legend = "";						
$p->control_type = $CONTROL_RADIOBUTTONS;		
$p->add_value("1", "Just right");						
$p->add_value("2", "Too short");
$p->add_value("3", "Too long");
$VALID_POLLS["1"] = $p;							

$p = new Poll;
$p->question = "What do you think about the amount of information you are given for each subject or species?";				
$p->returnToURL = "../index.php";				
$p->legend = "";						
$p->control_type = $CONTROL_RADIOBUTTONS;			
$p->add_value("1", "Just right");				
$p->add_value("2", "Too much");
$p->add_value("3", "Not enough");
$VALID_POLLS["2"] = $p;
?>

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Post Reply