|contact form with auto generated confirmation number|
php, auto generated, mail form, confirmation , code, script,send
I am trying to create a php mail form that upon submission it will generated a confirmation code and send it to both the client and the admin.
I don;t have any problems creating the form, or even make an email be sent back to the user (client) once they have filled it out.
my question is the auto generated confirmation number, and how can I added into the reciept to be sent both to sender and receiver.
Any help is much appreciated.
How about something like: $Confirm='CN_'.time().'_'.rand(0,9);
I added a single random number to the end of the string on the off chance there is a collision on the exact time a message is sent... It should not effect ordering or sorting and the time can easily be extracted from it. Anyway, my first thought for a quick, simple unique confirmation number.
Hi TheMadScientist, So Can i just echo out $confirm?
Hi TheMadScientist, So how would I include it to be sent both to recipient and sender so both parties can get same confirmation code.
Thanks for all your help.
Without seeing the code you are using I can't really tell you what to do, except to say, put the variable $confirm in the message body...
mail('recipient email','subject',"Confirmation Number: ".$confirm."\n\nmessage text",'headers');