PHP PollUser Manual Visit PHP Poll →
Settings & maintenance

Security and privacy

How PHPPoll keeps your polls secure and your voters private: protected data folder, hashed passwords, CSRF tokens, safe uploads, anonymous IP hashes and server tips.

PHPPoll is built with security and privacy in mind. This page lists what is already protected and what you should check on your server.

Built-in security

AreaProtection
Admin loginPasswords are hashed, login is locked for 15 minutes after 5 failed attempts, the session ID changes on login.
Admin formsCSRF tokens on every form. Destructive actions need a confirmation.
OutputAll texts from visitors are escaped before display, preventing cross-site scripting (XSS).
VotingServer-side validation of answers, honeypot, minimum fill-in time, captcha option, bot filter. See Prevent duplicate votes and spam.
UploadsOnly real JPG, PNG, GIF and WebP images up to 3 MB. The uploads/ folder cannot execute PHP.
CSV exportProtected against spreadsheet formula injection. See Export poll votes to CSV.
Data storageXML files, written atomically with file locking, so simultaneous votes cannot corrupt them.

Protect the data folder

The folder data/ contains settings (including the password hash) and all votes. Make sure it cannot be opened in a browser.

  • Apache: the included .htaccess files already deny access.
  • nginx: add a rule to your server block, adjusting the path:
    location ^~ /poll/data/    { deny all; return 404; }
    location ^~ /poll/uploads/ { location ~ \.php$ { deny all; } }
  • IIS: use request filtering to deny the data folder.
  • Best practice: move the folder outside the web root and point to it in config.php:
    define('PP_DATA', '/home/youruser/phppoll-data');

Test it: open https://www.example.com/poll/data/settings.xml. You must see an error, not the file.

Privacy of your voters

  • IP addresses are never stored. Only a salted, irreversible hash is saved to enforce the vote limit.
  • No third-party services, trackers, fonts or analytics are loaded by polls.
  • The only cookie set on voters is a small one that remembers that they voted (when cookie limits are on).
  • Names, emails and comments are collected only if you enable them. See Collect voter details and comments.

Recommendations

  1. Use HTTPS on your website.
  2. Choose a strong admin password. See Admin panel login and account.
  3. Keep PHP updated on your hosting.
  4. Take regular backups. See Backup, restore and moving to a new server.
  5. Optionally protect the admin/ folder with an extra HTTP password.

Last updated