0
Adding a refernce number to a form
Explorer
,
/t5/dreamweaver-discussions/adding-a-refernce-number-to-a-form/td-p/623977
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/adding-a-refernce-number-to-a-form/m-p/623978#M104743
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
>
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
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
mac-in-the-mountains
AUTHOR
Explorer
,
/t5/dreamweaver-discussions/adding-a-refernce-number-to-a-form/m-p/623979#M104744
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
I had it working ten minutes after reading your post. Great tip
Thanks.
Dave
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/dreamweaver-discussions/adding-a-refernce-number-to-a-form/m-p/623980#M104745
Feb 08, 2007
Feb 08, 2007
Copy link to clipboard
Copied
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
"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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

