Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Adding a refernce number to a form

Explorer ,
Feb 07, 2007 Feb 07, 2007

Copy link to clipboard

Copied

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
TOPICS
Server side applications

Views

209
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 07, 2007 Feb 07, 2007

Copy link to clipboard

Copied

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
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 08, 2007 Feb 08, 2007

Copy link to clipboard

Copied

Perfect!!

I had it working ten minutes after reading your post. Great tip

Thanks.

Dave

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 08, 2007 Feb 08, 2007

Copy link to clipboard

Copied

LATEST
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


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines