Jump to content

Please help


Nazwa29

Recommended Posts

This if what I have now

 

<?php
function sernum()
{
    $template   = 'XX99-XX99-99XX-99XX-XXXX-99XX';
    $k = strlen($template);
    $sernum = '';
    for ($i=0; $i<$k; $i++)
    {
        switch($template[$i])
        {
            case 'X': $sernum .= chr(rand(65,90)); break;
            case '9': $sernum .= rand(0,9); break;
            case '-': $sernum .= '-';  break;
        }
    }
    return $sernum;
}

    /**
    * try it
    */
echo '<pre>';

for ($i=0; $i < 1; $i++) echo sernum(), '<br/>';

echo '</pre>';
?> 

And i want the code to be sent of to my email and person that inputs email in text box

Link to comment
https://forums.phpfreaks.com/topic/283591-please-help/#findComment-1456923
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.