close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

cross check votes on dynamic page

Thread began 2/11/2010 5:10 pm by robert329616 | Last modified 2/11/2010 7:39 pm by robert329616 | 697 views | 4 replies |

robert329616

cross check votes on dynamic page

Hello,

I am creating a photo contest that needs to work by tomorrow (fun never ends)
I created a database with a table to store the name, email address, IP, time stamp, pet name, image and another table to store the votes, time stamps, email address, Pet Name and IP.

I will have the user register, upload and vote for their pet, or have a friend vote a pet after they register.

My Question is; The contest allows only one vote per email address. If I have all of the entrants photos with a vote button underneath dynamically populate the page, how can I check to make sure they have not already voted.

I am going to make the page only accessible to registrants.

Any help would be greatly appreciated.

Rob

Sign in to reply to this post

Jason ByrnesWebAssist

have the login page store the users email address in a session variable when they log in.

If you are using security assist, this is fairly simple, edit the authenticate user server behavior on the login page, on the third step, you can chose columns to store in session variables. add the email address column.


On the page with the vote button, add a recordset to filter the email address column of the votes table on the email address session variable.

use the Dreamweaver Show region if recordset is empty behavior to only show the button if the email address is not found in the recordset.

Sign in to reply to this post

robert329616

Jason,
Thanks for the help. Last question (hopefully); When a user votes based on the tables I mentioned above how do I add the votes each image received and show the top 20 on the home page? I am not sure how to set up the recordset.

Thanks again,
Rob

Sign in to reply to this post

Jason ByrnesWebAssist

I assume one record is stored for each vote?


SELECT COUNT(idColumn) as numVotes, petName FROM votes GROUP BY petName


GROUP BY petName will return one row for each petName. numVotes will contain the number of votes for each petName. you could add ORDER BY COUNT(idColumn) DESC so that the number of votes is orderred highest to to lowest.

Sign in to reply to this post

robert329616

Jason,

Yes, I will have one record per vote. Thanks again, you guys do a great job!

Rob

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...