Mam taki skrypt sondy:
<? /* to do: create an admin script which allows you to: edit the questions remove a question add a question etc etc etc */ include(\"poll.ini\"); $action = \"\"; include($HeaderFile); echo \"Unable to access poll data file ($BasePath$PollDataFile). Please run the configuration script.\"; include($FooterFile); } $PollQuestion = $PollDataFile1[0]; function GetResults($PollQuestion, $PollNumbers, $PollQuestions, $PollVotes) { include(\"poll.ini\"); $PollTotalVotes = 0; for ($i = 0; $i < $PollNumbers[1]; $i++) { $PollTotalVotes = $PollVotes[$i] + $PollTotalVotes; } if ($PollTotalVotes > 0) { for ($i = 0; $i < $PollNumbers[1]; $i++) { $tmp = ($PollVotes[$i]/$PollTotalVotes) * 100; $tmp2 = (int) $tmp; $tmp3 = 100 - $tmp2; if ($tmp == 0) { echo \"<img align=absmiddle src=\"$PollGraphEdgeFile\" height=$PollGraphHeight width=1><img align=absmiddle src=\"$PollGraphOffFile\" height=$PollGraphHeight width=$tmp3><img align=absmiddle src=\"$PollGraphEdgeFile\" height=$PollGraphHeight width=1><br>\"; } elseif ($tmp == 100.00) { echo \"<img align=absmiddle src=\"$PollGraphEdgeFile\" height=$PollGraphHeight width=1><img align=absmiddle src=\"$PollGraphOnFile\" height=$PollGraphHeight width=$tmp2><img align=absmiddle src=\"$PollGraphEdgeFile\" height=$PollGraphHeight width=1><br>\"; } else { echo \"<img align=absmiddle src=\"$PollGraphEdgeFile\" height=$PollGraphHeight width=1><img align=absmiddle src=\"$PollGraphOnFile\" height=$PollGraphHeight width=$tmp2><img align=absmiddle src=\"$PollGraphOffFile\" height=$PollGraphHeight width=$tmp3><img align=absmiddle src=\"$PollGraphEdgeFile\" height=$PollGraphHeight width=1><br>\"; } if ($PollVotes[$i] == 1) { } else { } } } else { } } if ($action == \"vote\") { $PollVoteValid = 1; if ($UseCookies == 1) { $PollCookieName = $PollCookiePrefix.$PollNumbers[0]; $PollVoteValid = 0; } else { } } if ($PollVoteValid == 1) { //Get Results $PollVotes[$vote] = $PollVotes[$vote] + 1; //Update Poll Data $FileToUpdate = $BasePath.$PollDataFile; for ($i = 0; $i < $PollNumbers[1]; $i++) { if ($i == ($PollNumbers[1] - 1)) else } for ($i = 0; $i < $PollNumbers[1]; $i++) { if ($i == ($PollNumbers[1] - 1)) else } include($HeaderFile); GetResults($PollQuestion, $PollNumbers, $PollQuestions, $PollVotes); include($FooterFile); } else { if ($PollWarnCheaters == 1) { include($HeaderFile); include($FooterFile); } else { include($HeaderFile); GetResults($PollQuestion, $PollNumbers, $PollQuestions, $PollVotes); include($FooterFile); } } } elseif ($action == \"viewresults\") { include($HeaderFile); GetResults($PollQuestion, $PollNumbers, $PollQuestions, $PollVotes); include($FooterFile); } else { include($HeaderFile); <p> <form action=\"sonda/poll.php\" method=\"post\"> <input type=\"hidden\" name=\"action\" value=\"vote\"> <? for($i = 0; $i < $PollNumbers[1]; $i++) { if ($i == 0) else } ?> //pokazanie wyników... //pokazanie sondy <br> </font> <table align=left border=0> <tr> <?php { <td><input type=\"submit\" value=\"Głosuj\"></td></form> <td> <form action=\"sonda/poll.php\" method=\"post\"> } else { <input type=\"hidden\" name=\"action\" value=\"viewresults\"><input type=\"submit\" value=\"Wyniki\"></td></form> } ?> </tr> </table> <? include($FooterFile); ?>
Gdzie mam wstawić to:
<?php { //pokazanie wyników... } else { //pokazanie sondy } ?>
żeby wyniki sondy pokazywały mi się w jednym oknie
Z góry dzięki i pozdrawiam