Jump to content


Photo

Is this done with php


  • Please log in to reply
8 replies to this topic

#1 lisa33

lisa33
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 30 August 2006 - 10:03 PM

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]

#2 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 30 August 2006 - 10:08 PM

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)
RTFM is an almost extinct art form, it should be subsidized.

#3 lisa33

lisa33
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 30 August 2006 - 10:14 PM

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)

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?

#4 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 30 August 2006 - 10:29 PM

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:

SELECT user_name FROM user_table WHERE user_name='uid' and vote_for_president = 1

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.:
UPDATE user_table SET vote_for_president=1 WHERE user_name='uid'

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)

RTFM is an almost extinct art form, it should be subsidized.

#5 lisa33

lisa33
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 31 August 2006 - 03:37 AM

Can dreamweaver perform something like this or do I need php?

#6 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 31 August 2006 - 06:33 AM

You'll need PHP - Dreamweaver is just a WYSIWYG HTML editor as far as I'm aware, it offers no advanced automatic script creation.

#7 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 31 August 2006 - 07:27 AM

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.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#8 steelmanronald06

steelmanronald06
  • Staff Alumni
  • Advanced Member
  • 2,004 posts
  • LocationOk

Posted 31 August 2006 - 12:33 PM

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.

#9 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 31 August 2006 - 12:36 PM

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


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.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users