Tell me, is it possible to somehow start the function in php by pressing a button?

I found this code here, but it doesn’t work.

<?php function dw($value){ echo $value; } ?> <html> <head> </head> <body> <?php wd('Привет!');?> <button value="OK" onclick=""></button> </body> </html> 

In general, it is necessary that everything be according to this algorithm:

1) User enters - IP check: if the user has voted, go to step 3; if not, suggest to click "yes" or "no"; 2) is added to the IP file; 3) displays the result of all the votes (how many "yes", how many "no").

Help to realize, make a free social project on the topic of ATO.

  • A few tips: - At 1 IP can sit hundreds or even thousands of users. - If the "cheating" does not matter, then hang the cookie, and then, when loading the page, check if there is a "cookie", then show the result, if not, you suggest to vote. - If cheating is important, then offer to enter an email address for voting, and in it a confirmation code + also hang a cookie. - Data about the votes can be stored in XML (if you do not want to bother with the database) it is convenient and works out of the box (simple xml). - ferrari
  • one
    Why not use the service to vote? For example , or [in general] ( yandex.ru/yandsearch?text=service voting site). - Sergiks

0