I would like to put a simple poll on my one of my websites. I have setup a php flat file poll in a subdirectory called “poll”. It contains the following files: poll.dat, results.php, setup.php and vote.php. The setup.php script contains the question and sets up an array for the options and another array for the number of votes. To run the poll, all you do is run the vote.php script and it displays the form with the question, options and the “vote” and “results” buttons. However, once a person votes, it automatically displays the results.php page. The poll works as intended.
If at all possible, I now want the poll form (contained in vote.php) and the subsequent results to automatically display in a html table I am using on my index.htm page which is in my main directory. In that table, I have tried using <?php require(“poll/vote.php”); ?> and <?php require($_SERVER[‘DOCUMENT_ROOT’] . ‘/poll/vote.php’); ?> and neither displayed the voting form nor did they cause any error messages.
Can anyone help me?