Jump to content

Random number generator on click which then emails number


danibee2k

Recommended Posts

Hi,

 

I hope I've posted this in the right place as this is my first time here, if not please let me know and I will move it! lol!

 

Ok, I need to create a form whereby on entering a Forename and an Email address, the user clicks submit and a random unique number is generated which is then emailed to the email address entered and to myself.  Does anyone have any suggestions of how I can do this.  I have no problems with creating forms it is more the random number generator and then emailing that to the entered email address that is causing me problems!  Worse comes the worse the number generated can become visible on click and simply email to myself if it is not possible to email it to the address just entered.

 

Don't know if that made any sense or not, please ask me if you need me to clarify!  Hopefully someone can help, it is urgent as I'm working to a deadline.

 

Thanks so much

 

Dani

It doesn't have to be particularly long, 5 or 6 numbers would be sufficient.  Sorry to sound ignorant (however I am!) but could I use this code to generate a unique number in a form field so that on submitting the form it could be emailed to myself and the email address the user entered?  As a bit more background, there is no need for any database linkage, the number is not going to be stored, simply emailed.

 

how long must that unique number be?

 

<?php
$rand = sha1(time()); // 40-chars
?>

It doesn't have to be particularly long, 5 or 6 numbers would be sufficient.  Sorry to sound ignorant (however I am!) but could I use this code to generate a unique number in a form field so that on submitting the form it could be emailed to myself and the email address the user entered?  As a bit more background, there is no need for any database linkage, the number is not going to be stored, simply emailed.

 

how long must that unique number be?

 

<?php
$rand = sha1(time()); // 40-chars
?>

 

yep that is no problem, not even in a database context

Brilliant!! You are an absolute star! Will have a go and see how I get on.

 

It doesn't have to be particularly long, 5 or 6 numbers would be sufficient.  Sorry to sound ignorant (however I am!) but could I use this code to generate a unique number in a form field so that on submitting the form it could be emailed to myself and the email address the user entered?  As a bit more background, there is no need for any database linkage, the number is not going to be stored, simply emailed.

 

how long must that unique number be?

 

<?php
$rand = sha1(time()); // 40-chars
?>

 

yep that is no problem, not even in a database context

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.