Anything Wrong With This Code Pls?
-
Hi There,
Would like to test out this invaluable plugin (Code Snippets), thanks to Shea Bunge and Verdi Heinz. However, I would like to be sure firsthand that the code is good to go before using it. ‘Coz I got it from a 10yr old thread in one of the support threads.
THe code is a string to generate random reference number for CF7 submissions using CF7 DTX plugin to create the dynamic field in CF7. Here is the code:
………………………………………………………………..
/* Generate Quote Ticket */
function genTicketString() {
$length = 8;
$characters = “0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ”;
for ($p = 0; $p < $length; $p++) {
$string .= $characters[mt_rand(0, strlen($characters)-1)];
}
return $string;
}
add_shortcode(‘quoteticket’, ‘genTicketString’);…………………………………………………………………..
Anyone code savvy here to pls check if it’s good and still compatible with current version of PHP.
Thanks a lot.
- The topic ‘Anything Wrong With This Code Pls?’ is closed to new replies.