As is it is a simple dynamic page creation requiring only few files...
- The poll creation page which is static
- The
processing.php
file which collects the data and inserts into the db
- The dynamic poll rendering page
polls.php
which renders the poll based on an auto-incremented id assigned to the poll.
- The
polls-results.php
which returns the results.
http://thepollsite.com/12345
.htaccess
is used to identify which poll to render as well as which results to render.
# Turns on Mod-Rewrite Engine
# ----------------------------------------------------------------
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
# Poll Pages
# ----------------------------------------------------------------
RewriteRule ^([^/]+)/?$ polls.php?id=$1 [QSA,L]
RewriteRule ^([^/]+)/?$ polls-results.php?id=$1 [QSA,L]
On both polls.php
and polls-results.php
you get the id with: $poll_id = $_REQUEST['id'];
and process from there.
The embed code is rendered in a simple dialog pop which provides the iframe code as shown.
Though there are frills you can add... its is really a simple process.