Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Perl variables into MySQL 1

Status
Not open for further replies.

tsp120

Programmer
May 21, 2003
52
US
I have the following situation. I have a form, written in Perl, CGI, HTML and Javascript. When this form is submitted, a javascript function verifies the validity of the information on the form. If this passes, it calls another Perl, CGI, HTML page which displays the information for the user to verify manually. At the bottom is a Submit and Back button. The Back button brings the user back to the form to change data. Everything up to here works fine.

When the Submit button is clicked, I want to Insert the values I now have stored in Perl variables into a MySQL database.

I don't know the best way to do this. Is it possible that I can write a Perl subroutine on the verification page that will Insert the data, and call this from ACTION in the FORM tag?

If not, can I call another Perl, CGI page to pass those variables and run the Insert on this new page? If so, how does that work, meaning how do I pass the variables?

Or, do you have any other suggestions?

One thing to note is that I already have the INSERT feature working when the verification page is loaded. When the user submits the form and it opens the verification page, I have the Perl script inserting the values into the database automatically. But, I want this to happen if and only if the user clicks submit.

Thanks!
 
So you have stored the data, then you ask the person to verify that what you have already put into the database is OK with them.

And the data is displayed as content, not as a form?

The thing to do is build a form with hidden fields for each piece of data. Submit this form when the person confirms the data is OK.

Do not add the data to the database before the person verifies it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top