homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

contact form with auto generated confirmation number
php, auto generated, mail form, confirmation , code, script,send

 11:02 pm on Jan 9, 2010 (gmt 0)

Hi All,

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.



 8:46 pm on Jan 10, 2010 (gmt 0)

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.


 7:55 am on Jan 11, 2010 (gmt 0)

Hi TheMadScientist, So Can i just echo out $confirm?


 7:59 am on Jan 11, 2010 (gmt 0)

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.


 6:05 pm on Jan 11, 2010 (gmt 0)

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');

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved