Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    91
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Could not work on Fedora3

    Works fine on win xp sp2 apm.
    But not works on fedora3.

    Code:
            <?
            // 파일 출력
            for ($i=0; $i<=count($view[file]); $i++) {
                if ($view[file][$i][view])
                    echo $view[file][$i][view] . "<p>";
            }
    
            // 투표한 사람만 결과가 보임
            if (get_cookie("ck_{$bo_table}_{$wr_id}") == "{$bo_table}_{$wr_id}")
                $is_poll = true;
            else
                $is_poll = false;
    
            $max = 1;
            $total = 0;
            $tmp = explode(",", $view[wr_1]);
            for ($i=0; $i<count($tmp); $i++)
            {
                $total += (int)$tmp[$i];
                if ((int)$tmp[$i] > $max)
                    $max = (int)$tmp[$i];
            }
    
            echo "<table>";
            $ans = explode("\n", $view[wr_content]);
            for ($i=0; $i<count($ans); $i++)
            {
                echo "<tr>";
                echo "<td>";
                echo "<input type=radio name='ans' id='ans$i' value='$i'><label for='ans$i'>";
                echo $ans[$i];
                echo "</label>";
    
                if ($is_poll)
                {
                    if ($total > 0)
                        $rate = ((int)$tmp[$i] / $total) * 100;
                    $bar = (int)((int)$tmp[$i] / $max * 100);
    
                    echo "</td>";
                    echo "<td width=200>";
                    echo "<table width=100% height=10 cellspacing=0 cellpadding=0 border=0>";
                    echo "<tr><td><div style='width:100%;height:10px;border:1px solid #8E959B;background-color:#ffffff'><img src='$board_skin_path/img/poll_bar.gif' width='{$bar}%' height='8' title='' border='0'></div></td></tr>";
                    echo "</table>";
                    echo "<td width=50 align=right>".number_format($tmp[$i])."명 &nbsp;</td>";
                    echo "<td width=70 align=right>".number_format($rate,2)."% &nbsp;</td>";
    
                }
                echo "</td></tr>";
            }
            if ($is_poll)
            {
                echo "<tr>";
                echo "<td></td>";
                echo "<td align=right>퀴즈참여자 총 &nbsp;</td>";
                echo "<td align=right>".number_format($total)."명 &nbsp;</td></tr>";
                // explanation
                  echo "<tr>";
               echo "<td width='8%'>설명</td>";
               echo "<td width='92%' style='border: 1px solid #0099FF'>";
    	echo $view[wr_2];
    	echo " </td>";
    	echo "</tr>";
            }
            echo "</table>";
            ?>
    The last code "//explanation " should be shown after get the "$is_poll = true;".


    What is wrong?
    Any comment would be appreciated.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,058
    Thanks
    10
    Thanked 96 Times in 94 Posts
    what version of PHP on fedora ? + what browser on fedora ? (+ what browser on win32)
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    New Coder
    Join Date
    Jun 2005
    Posts
    91
    Thanks
    19
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by firepages
    what version of PHP on fedora ? + what browser on fedora ? (+ what browser on win32)
    Dear firepages,

    Fedora3 has apache 2.0.54, php 4.3.11, mysql 4.1.11, and win xp sp2 has same versions.
    The browser is ms internet explorer and slimbrowser.

    If u want, I'll copy my php.ini here.

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,058
    Thanks
    10
    Thanked 96 Times in 94 Posts
    Hi , OK then I guess that only leaves the browser or how the cookies are being accessed , I have never used slimbrowser so I cant help much there.

    I am guessing that the cookie is not getting set in slimbrowser OR the get_cookie() function is being affected by the register_globals directive in the php.ini

    can you post the get_cookie() function here ?

    also try PRINT_R($_COOKIE); and see what cookies are actually set.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •