Hi, i am a computer science final year student, i was thinking of creating an online voting/polling system,the system could include surveys as well. I really need some ideas in designing the system and any idea you send to me will be highly appreciated.

Recommended Answers

All 10 Replies

Hi, i am a computer science final year student, i was thinking of creating an online voting/polling system,the system could include surveys as well. I really need some ideas in designing the system and any idea you send to me will be highly appreciated.

The best way to tackle this I believe is to download an open source voting/polling script, and take a look at how it functions. (search sourceforge.net, hostscripts.com, google)
Most the polling scripts will come with a administration panel (the good ones at least), I dont believe its complete withought it, so you'll have to also look at developing both the polling frontend, and an admin area to manage, create the polls.
Theres a lot of ways to actually go about doing the project, but if I were to do it, I'd first create a simple templating system (having your php logic seperated from your design makes it much less confusing), then develop the admin panel first (think of how the database will store all the results, and how the admin will create the forms), then go on to the actual forms that will be the frontend.

Though it sounds simple, a polling system can be a lot of work.
If you want to really go overboard, try searching the web for AJAX, and use it to validate, populate, submit forms on the poll frontend.
There arent many ajax based polling systems out there open source, (i checked) so it will be unique.

Pretty much you'll have to look into php php sessions, dynamic php forms, javascript (or php) form validation, mysql database functions, css, AJAX if you go further. Searching the net should yield alot of info.

Googluck.

Hi there,
Thanks for the info, i will look into the suggestions you made, and carry on from there.Is PHP the most appropriate programming language to use, or are there other ones that are good for creating online voting systems.Thanks again.

PHP, CFM and ASP are ideal for voting system. All these can do the same thing using different scripting methods. It is more important to know what kind of server you are going to use (depends on budget too). PHP is open source and free to use from installing apache server to database connectivity, which may be a good solution for a course work that is low in budget.

However, if you are looking for something that is highly complex or required more security, then I would suggest JSP. It should be very straight forward if you know JAVA.

Thanks for the info, i was wondering how i would be able to go about creating the admin side of the system, how would the administrators be able to create new polls for the system. Thanks

Thanks for the info, i was wondering how i would be able to go about creating the admin side of the system, how would the administrators be able to create new polls for the system. Thanks

Its easy to just be concerned about the database first, as this will store the polls.
First create the structure for your database. If you look at existing poll scripts, you can view the database structure using phpmyadmin.

The idea would be to save the info needed for each individual poll, and all the form fields on the poll.

You could store each poll in a table called 'polls' with the columns, id, title, description, creator, date, published etc etc.
This singles out each poll and also allows you to keep track of who created it and when (creator, date) and if its published or not and other optional features.

You can then create a table for all the poll's form fields called poll_fields.
First you will need to make sure the poll fields are linked to an existing poll, so you give it a table column called poll_id. This will have the value of one of the id's of the rows in the 'polls' table.
Its also good to have an index for your poll_fields table, so you can give it an id column also. (so you can identify each row on its own)

Then you can add another table column called form_field, this will hold your form fields. You can also add other colums like, field_type, field_description, field_length etc.
When you create a form fields, you can save each one into a different row in this table, but have the poll_id set to the same poll id.

So an example poll saved in the db would be:

Table: polls
id = 1, title = 'My first Poll', description = 'An example Poll', creator = 'myname', date='some_date', published='1'.

Table: poll_fields
id = 1, poll_id = 1, form_field = 'name', field_type = 'textbox', field_description = 'Fill in your Name';
id = 2, poll_id = 1, form_field = 'age', field_type = 'textbox', field_description = 'How Old Are You?';
id = 3, poll_id = 1, form_field = 'sex', field_type = 'textbox', field_description = 'Are you male or female?';

Now all you have to do is create the php pages that allow a admin to input this data into the db for each poll, and edit the data.
You'll notice that all the field_type's are textbox. Usually you will want textarea, selectbox etc. You can also add this, but you will need one more table to hold the options for a selectbox. Its just like the poll_fields except you link it to the poll_fields id, instead of the poll's id.

Hope that helps... :-|

i am new 2 this forum

good day everyone i actually need information on why computer science why computer science is not a natural science

Hi. Welcome to Daniweb. Your question is nowhere related to php. You can post your question in geeks' lounge forum! or even better, google it !

Have a look at the democracy sections of www.myverdict.net. Is this the sort of thing you're looking to build.

Having built the site from scratch, I can tell you exactly how I went about it.

Best Regards

Taffd

@Taffd I am interested in the site you built, I went to the link but it does not seem to exist anymore. Please tell me how you went about it.

Regards,
Yeungn

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.