Jump to content

Is this done with php


lisa33

Recommended Posts

Hey guys im very new to php and Im working on a website that would need to look like this. I threw this together in Dreamweaver to give you an idea. I need it to be a voting site where there is a check box under each pic where an individual would view all pictures then at the end choose one and click vote having a box appear with the total. Now I dont mind if the person votes more then once however I only want their last vote to count. Now could this be done using php? And if so can anyone point me in the right direction. Thank you so much!! Lisa

P.s. I apologize but when you view the sample the pictures dont appear but you can still see what I am trying to aim for!

[attachment deleted by admin]
Link to comment
Share on other sites

If this user is known to you, as in 'has logged-in', you can keep the voting count in the database with the user's data.

If any site vitisor can vote, then all you can do is collect as much data as you can gather, such as referer (not always set), ip address (not always trustworthy), browser data, etc. and store that in the database. And use that to compare with each new vote.

Ronald   8)
Link to comment
Share on other sites

[quote author=ronverdonk link=topic=106319.msg425036#msg425036 date=1156975733]
If this user is known to you, as in 'has logged-in', you can keep the voting count in the database with the user's data.

If any site vitisor can vote, then all you can do is collect as much data as you can gather, such as referer (not always set), ip address (not always trustworthy), browser data, etc. and store that in the database. And use that to compare with each new vote.

Ronald   8)
[/quote]
Hey Ronald, Thanks for the quick reply...but Im sorry I didnt really understand....The only people who can vote are those who are logged in. This is going to be a members paid site. I would like everything to be done automatically if that is possible...So would this be done using php?
Link to comment
Share on other sites

Yes. Assuming that you have your user data in the database, you can use that for keeping track of his/her voting using PHP and your database (MySql?) query language.
When the user votes, you check his db data to see if he/she has voted already:

[code]SELECT user_name FROM user_table WHERE user_name='uid' and vote_for_president = 1[/code]

If that query returns positive: you can send the user a message: "You have already voted".

If the query returns negative, you can store his vote in the database user data, e.g.:
[code]UPDATE user_table SET vote_for_president=1 WHERE user_name='uid' [/code]
Then send a message "Your vote has been registered".

The above is not exhaustive, just a sample of how you could accomplish this.

Ronald  8)
Link to comment
Share on other sites

actually, dreamweaver (at least, version 8 does) has php syntax highlighting as well as a few basic code completion buttons. But PHP is certainly not the main focus of dreamweaver.  I'm not sure if you can even link the php interpreter to it to test a script in it's internal browser or not.  I would definately not recommend it for php scripting.  But that's just me. Some people swear by it.  Though, some people also swear by plain old notepad too...but regardless, there aren't any editing programs out there that will automatically make this script for you. You are going to have to either find a premade script or else make one yourself. Or hire someone to do it for you. 

moving this thread to misc section. if you have a specific question about a piece of code, feel free to start a new thread about it.
Link to comment
Share on other sites

I hear word that adobe bought dreamweaver, but if you need a good IDE, choose PHP Designer Pro. 

As per your question.  Yes this is all done in PHP, and it is extremely basic.  Go over to phpfreaks.com main site, and click on tutorials.  There you will find a fully fleshed Member System and I do believe a tutorial on how to set up a poll/vote.
Link to comment
Share on other sites

[quote author=steelmanronald06 link=topic=106319.msg425316#msg425316 date=1157027635]
I hear word that adobe bought dreamweaver, but if you need a good IDE, choose PHP Designer Pro.
[/quote]

yes, adobe bought out macromedia a while back.... and so far, it's been only good come of it. dreamweaver 8 is by far the best implementation of the system to date, and it does have a great number of resources to help users out more than its predicessors.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.