php help

    Date: 12/20/06 (PHP Community)    Keywords: no keywords

    i have a problem and i hope you guys can help me out. why does when the hintchar is actually equal to wordinput, it appears as "you have entered the wrong hint". ?



    function generate_hint($wordinput, $hintchar)
    {
    $progress = mask_string($wordinput);
    for ($i=0; $i<=strlen($wordinput)-1; $i++)
    {

    if ($hintchar == $wordinput{$i})
    {
    $progress{$i} = $hintchar;
    }

    }
    return $progress;

    }

    generate_hint($_GET["wordinput"], $_GET["hintchar"]);

    if (isset($_GET['hintchar']))
    {
    $solveword = $_GET['hintchar'];

    if ($wordinput == $hintchar)
    echo "

    You entered the correct hint!

    ";
    else {
    echo "

    Your entered the wrong hint!

    ";
    }
    }
    else echo "";
    ?>

    Source: http://community.livejournal.com/php/523687.html

« Security concerns with User... || php-based IMAP client? »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home