PDA

View Full Version : making a poll onto a webpage



webing
05-24-2008, 08:04 AM
Hi, i want to add a poll but on my index.html page and not on it's seperate page, i've searched on google but could only find how to make it on a seperate folder. can someone give me step by step on how to add a poll to my homepage(index.html). i want to put it on 1 of the sidebars.

Thanks in advance

Chella
05-24-2008, 01:28 PM
There are free services that offer polls in where you create, then copy and paste the code into whichever page you'd like. Is this the sort of thing you're looking for?

webing
05-24-2008, 01:52 PM
there are but the ones i found send the results to their own website and have a annoying link.i was wondering if i could make 1 of my own so that their are no links and that the results are on the same page.

Chella
05-24-2008, 11:12 PM
Since polls require that you pass information between pages, I don't think you can write one that is strictly HTML based.

You can use cgi or php coding to create one.

webing
05-25-2008, 04:30 AM
ok, so that would require me to rename index.html to index.php? i don't really mind. can you tell me how to do it if i rename it then?
Thanks.

Chella
05-25-2008, 10:52 AM
It requires you writing a script in PHP, and is time consuming and requires knowledge of, well, PHP.

Others have poll scripts that are available to use, if you'd like to take a look, just query "php poll script" in a search engine and a lot of results turn up.

code_m
05-25-2008, 01:57 PM
I'm sure if you look around in Simple Scripts and Fantistico you'll find some poll stuff.

Just install it and then link to it, yes, it's not in-bedded, but it's still on YOUR website.

webing
05-26-2008, 05:22 AM
i know there are like advanced poll, but i really only need it if it's going to be on my main page, it's not that important anyways, thanks for the answer and i will have a good search still if i can find anything, thanks.

pghcollectibles
05-26-2008, 09:02 AM
do you have a question you want to ask for the poll? do you want users to be able to create there own polls etc. it wouldnt be that hard to give you some extra help if i knew more specifically what you wanted.

what i need:

answer to ? above,
link to page where you want the poll, unless you know how to insert it where you want it,
general idea of where you want it placed on the page,

how you want the results back:
in an email to you,
displayed on the page, aand if so what do you want people to see on the page:
a pie chart,
percents,
total vote count etc.

give me some more info, thanks

webing
05-26-2008, 09:22 AM
What i want is a simple poll

the question here?

option:1
option:2
option:3
option:4

Sumbit


When they sumbit, the poll goes to the results which should show number of votes on everything. i need the poll to be small (so that it can fit my siderbar) so that means the results should only say number of clicks and not a big line showing the percent.

heres a example of how i think the results should be:

option 1: 100 votes
option 2: 235 votes
option 3: 125 votes
option 4: 100 votes

so in summary: i want 1 simple small poll into my sidebar, when someone sumbits, the results are shown on the page ( i guess it needs to be a cookie?)
the results need to fit a siderbar which is around 200 width i think.

I do not really care how the poll or the results show up or look like, just so that they fit my sidebar which should be around 200 pixels wide.if possible even smaller would be ok.

Just for info, my question would be:

How many domains do you own?

1-3
3-6
6-9
9+

if what i'm asking for too long or just impossible then don't worry, as i said i do not need it instantly and i'm still in the very, very low stages of php :P.
Thanks.

i have made a mysql with 3 tables, first one is called "poll" and it has the question, second one is called:"questions" which is where the answers go and the third one: "responses" which i guess is the results or something like that.
i wonder- do i even need them?

pghcollectibles
05-26-2008, 12:28 PM
ok i just installed advanced polls for this test. i installed it into a subfolder called polls. there are demo ones i did not mess with yet. i went to that folder with my browser and viewed the index.php. it showed the demo polls on the right side and the code to insert into my page on the left side.

i went to polls/admin folder and signed into my admin page. i created a new poll with the ? "is this what you want" my options were yes and no i used the logged off option for the poll. i believe this allows you to vote even if you are not logged on ;) i went back to the polls/index.php and saw the code and it was good.

i created a new file called test001.php (http://www.pghcollectibles.com/polls/test001.php) in the same folder.

if you do not know much about php all i can say is theres no time like the present to start learning after all you are a webmaster using a linux server and it is what you will need to start making dynamic web pages. this link (http://www.w3schools.com) will help you when you get a chance and this one (http://www.php.net).

i dont know how complex your website is but you will have to change the name of your page (index.html ?) to index.php that may involve doing other things as well depending.

the admin page allows you to setup the widths of your poll and many other things.

the part that goes before your html means it needs to be inserted anywhere before the tag <html> it should be safe to say you could click at the very beginning of anything at all and insert it there.

the rest of the code would go exactly where you want it to appear on your page.

there is a help section within the admin page you could use or there are links to their website as well and im sure there are people on this board who use it as i guess i will be eventually.

when you install this it will ask for an admin user name and password that you will use to log into the admin section with. it also creates the database for you. It appears to use 9 tables in the database username_adpo1. you can edit your polls view results reset them and control output through the admin area.

First thing to do:
do you have many pages that link to your index.html page?

webing
05-27-2008, 05:58 AM
hi, thanks for the answer and for your time, about your question,nothing links to my index.html, everything is linked to www.example.com ( i know that is the index, but still even if i rename my index to index.php, all links will still go to the right place, so nothing big deal me renaming my index)

also if i rename my index to .php, do i need to rename the other web pages too? or i only need to rename pages to .php if they have php code in? well if it's like the second question, then i guess i will have to put the poll onto my index since my other webpages are indexed as .html just as today so if i rename it, it will be atleast 1 month till they get updated, or i could put redirects onto each page to link from the .html file to the .php file so that even if people go to the .html they will still end up in the right place.

well unluckily(or luckily, lol) i'm going holiday today for 1 week so i won't be able to do alot now, but if you can answer my questions above, i think i will be able to do it when i come back. and yes i have been to w3schools but php is kind of hard to remember unlike html so i will need to go over it a few times when i find some time to.

Thanks for your answers and your time again, really appreciate it.
oh and 1 more question(sorry) advanced poll only takes 1 mysql database, but in it you can make more than 1 poll, does that mean i can make like 5 different polls, all pointing to the same mysql or that would not work?

Chella
05-27-2008, 08:44 AM
also if i rename my index to .php, do i need to rename the other web pages too?

You'll only need to rename pages to .php if they contain PHP code.


oh and 1 more question(sorry) advanced poll only takes 1 mysql database, but in it you can make more than 1 poll, does that mean i can make like 5 different polls, all pointing to the same mysql or that would not work?

You are correct. You'll be able to make multiple polls in one database.

pghcollectibles
05-27-2008, 11:32 AM
why would it take a month to update something? maybe i didnt understand that. the instant you click on save changes or if you use ftp and upload and it is on hm server it is available.

personally redirects take time for the browser to reload and sometimes can be annoying to the user but maybe a mod_rewrite would be appropriate for that instead, but the redirect would certainly work its just not as fast or should i say professional looking

as far as learning a new language goes i think syntax is always most important so i mainly study that first and learn about variables. then i just learn the coding as i need it. most code has one basic function it does well or its made for. its just when you want something complicated you end up using combinations of basic stuff.

let us know if you need more help. if your gone for a week, this thread might be on page two or three by then

webing
05-29-2008, 02:35 PM
hi, i managed to get on the internet for a few moments, thanks for your answers, i ment search engines take time to edit their webpages and stuff so i would need a redirect or something similiar. better reply later.