Contact Form 7 – Reference number using date/time stamp
-
First of all, I found this thread: Contact Form 7 – Generating Refrence Number Awesome solution from AMCD.
I was thinking though, in my case, use of the date/time would be better than random.
So, question is, what would need to be changed in here to set it as a date/time stamp? Something about the ‘mt_rand’ right?
/* Generate Quote Ticket */
function genTicketString() {
$length = 8;
$characters = “0123456789”;
for ($p = 0; $p < $length; $p++) {
$string .= $characters[mt_rand(0, strlen($characters)-1)];
}
return $string;
}
add_shortcode(‘quoteticket’, ‘genTicketString’);
- The topic ‘Contact Form 7 – Reference number using date/time stamp’ is closed to new replies.