It would probably be really useful if we could see some of the code you've been writing. It's hard to tell you what's going wrong when we can't see what you're doing in the first place.
If you want to learn file input/output, check here: File Input and Output. This will probably give you all the information you need, but if you need more, you can also get some more information about the print function and check out a recent thread that dealt with a similar issue: How do I print output to STDOUT instead of to an HTML file?.
If you still need help after that, show us some of your code, and maybe we can help a little more. Good luck!
- Sherlock
| [reply] |
Some stuff to watch for:
- Write the votes into an external file (flat text file would usually do the trick)
It should look something like:
$vote = 'somefile.txt';
open (VOTE, "+>>$vote") or die "Cannot open output file: $!\n"
+;
seek VOTE, 0, 0;
while (<VOTE>) {
# you read the votes here and put them into appropriate va
+riables
}
# increment the voting.
seek VOTE, 0, 0;
truncate $vote, 0;
# print your votes back to the file.
- Do not cache your pages by including a header, and usually an HTML meta tag helps like:
<META Http-Equiv="Pragma" Conent="no-cache">
- beware of people voting too many times.. you should not allow someone who just voted to vote again and again..
You could also post some code.
He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life. | [reply] [d/l] [select] |
| [reply] |