mardi 27 décembre 2016

For loop doesn't regen random string, stays the same

So I m trying to get a random string generator to work with a for loop. I have gotten it to loop the number of times it should but it refuses to generate a new string per loop. Can someone look at my code and show me where i went wrong? Also there is no way of using unqid so do not mention it please.

if($_SERVER['REQUEST_METHOD'] == "POST")
{
    $key = $_POST['keysd'];
    if(isset($key) && is_string($key))
    {
        switch($key)
        {       
            case "ksc";
            $algor = "78.0000.".rnumstr(7);
            break;

            case "kpl";
            $algor = "76.0000.".rnumstr(7);
            break;

            case "kfi";
            $algor = "D01EB0A01472".rnumstr(1).strtoupper(ralphstr(3));
            break;
        }

            $sum = $_POST['sum'];
            $alg = $algor;
            if(isset($sum))
            {
                for ($i = 0; $i < $sum; $i++)
                {
                    echo $alg.'<br/>';
                }
            }
    }
}




Aucun commentaire:

Enregistrer un commentaire