General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 9th, 2003, 06:04 PM
sass sass is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 1 sass User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Voting poll article problem

Hi to all.

Please help me with my poll problem.
This script is great and i want to put poll to my site.
When i include poll.php and than vote, script redirect to next page and show result.
How can i after voting open the same page (index) with result on right place.

Sorry about language.

Reply With Quote
  #2  
Old April 13th, 2003, 02:40 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Hi Sass,

The best quickest way you can go about doing it is to have the form submit to $_SERVER['PHP_SELF'] rather than to the results page...

You can then insert a hidden html tag on your voting page. When the form is submitted, check to see if the hidden tag is set... if it is, it means the vote has been submitted... Then just copy the code from the result page, and paste it into your index page.

By using an IF statement, you can display the appropriate page:
Code:
if (hidden_variable){
   display results;
} else {
   display voting question/poll
}

If you need further explanation, please let me know...
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #3  
Old April 21st, 2003, 12:30 AM
aroc725 aroc725 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 6 aroc725 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post Voting Poll article

This was a good article, but I'd like to point out a couple of minor errors as well as make a suggestion:

1) In the "Page 3: Adding a poll to the database" section, the paragraph starting with

"Let's take a look at how we add a poll to our database..."

the last sentence states

"The GetNewPollDetails function simply displays a HTML form containing five fields:..."

but there are actually six fields, one for the poll question and five for the poll answers.

2) The code for the "AddPoll" function compares the $answer1, $answer2, etc. variables with the empty string, but I would think the trim() function should be called on the variables before doing the comparison.

3) Finally, I think it would be interesting to see an implementation of the voting poll application using an XML file as the backend, instead of a database.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Voting poll article problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT