Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member ubunreal's Avatar
    Join Date
    Apr 2002
    Location
    Brisbane
    Posts
    263
    Member #
    62
    I use the following code to display the Poll on my page:
    PHP Code:
    //Function to display the Poll
    FUNCTION poll($which_poll$poll_fill$main_question$no_of_options)
    {
        IF (isset(
    $HTTP_COOKIE_VARS['xyuri_poll'])) 
        {
            ECHO 
    "Display Results";
        } ELSE {
            
    $contents ""
            
    $x 0;
            While (
    $x $no_of_options)
                {
                
    //Get OPtion Text for current Option
                
    $option_text mysql_result($poll_fill$x"opt_text");
                
    $option_number mysql_result($poll_fill$x"opt_no");
        
                
    $contents "$contents <input type='radio' name='option_voted' value='$option_number'> $option_text <br>";
                
    $x++;
                }
            
            
    //Run another function to draw up the table and ****.
            //All variables for the function will be inserted into the main output here.
            
    $table_header "Poll";
            
    $table_content "$main_question<hr><form action='_vote.php' method='get'>
                <input type='hidden' name='which_poll' value='
    $which_poll'>$contents<input type='submit' value='VOTE'></form>";
            
    easy_table ($table_header$table_content);
        }

    IF (isset(
    $contents)) {unset($contents);}
    IF (isset(
    $x)) {unset($x);}
    IF (isset(
    $option_number)) {unset($option_number);} 
    it doesnt want to display "Display Results" when the cookie exists though but if i take out all the **** and just put
    PHP Code:
    //Function to display the Poll
    FUNCTION poll($which_poll$poll_fill$main_question$no_of_options)
    {
        IF (isset(
    $HTTP_COOKIE_VARS['xyuri_poll'])) 
        {
            ECHO 
    "Cookie Set";
        } ELSE {
            ECHO 
    "No Cookie Set"
        
    }

    then it will work correctly.

    is there something i am missing or overlooking ? any solution ?

  2.  

  3. #2
    Senior Member ubunreal's Avatar
    Join Date
    Apr 2002
    Location
    Brisbane
    Posts
    263
    Member #
    62
    ok, nevermind, its fixed now


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:58 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com