Skip to main content
Inspiring
February 7, 2007
Question

Adding a refernce number to a form

  • February 7, 2007
  • 1 reply
  • 244 views
Hi Folks,

I have a form on my website which acts as a questionanire. As the data is purely qualitative I've not set it up to insert the data into a databse, only to forward it via a formail page to my email address. I would however like to add sequential reference number to every form. It's all set up in PHP with a MYSQL databse tie dinto oter parts of the site, so I could use a table to hold teh reference number if necessary, although I don't really need the number for anything more than to distinguish one email from another when they're piled up onmy desk.

My guess is that I need to ctreate a table to hold the number then use that number as a hidden field which will be submitted with the form then somehow (and this is the bit I'm not sure about) add 1 to the refence number in the databse table when the submit button is clicked.

Can anyone suggest a better way or help me with the code to add to the submit button which will increment the database number?

Cheers

Dave
This topic has been closed for replies.

1 reply

Inspiring
February 7, 2007
Use a simple page counter like some might use to count visitors.
No need to create a database table just to get a unique id.
Unfortunately I'm a ASP developer so can't help with PHP, but I'm sure there
are plenty out there.

Just append the counter variable to your e-mail and you're done.


"mac-in-the-mountains" <webforumsuser@macromedia.com> wrote in message
news:eqc8ab$f26$1@forums.macromedia.com...
> Hi Folks,
>
> I have a form on my website which acts as a questionanire. As the data is
> purely qualitative I've not set it up to insert the data into a databse,
> only
> to forward it via a formail page to my email address. I would however
> like to
> add sequential reference number to every form. It's all set up in PHP
> with a
> MYSQL databse tie dinto oter parts of the site, so I could use a table to
> hold
> teh reference number if necessary, although I don't really need the number
> for
> anything more than to distinguish one email from another when they're
> piled up
> onmy desk.
>
> My guess is that I need to ctreate a table to hold the number then use
> that
> number as a hidden field which will be submitted with the form then
> somehow
> (and this is the bit I'm not sure about) add 1 to the refence number in
> the
> databse table when the submit button is clicked.
>
> Can anyone suggest a better way or help me with the code to add to the
> submit
> button which will increment the database number?
>
> Cheers
>
> Dave
>


Inspiring
February 8, 2007
Your very welcome

"mac-in-the-mountains" <webforumsuser@macromedia.com> wrote in message
news:eqet9r$o5d$1@forums.macromedia.com...
> Perfect!!
>
> I had it working ten minutes after reading your post. Great tip
>
> Thanks.
>
> Dave