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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

querying database using cgi-scripts, help!

Status
Not open for further replies.

dmaranan

Programmer
Aug 14, 2001
46
US
I've got a programming problem that I believe only a javascript can solve. I remember that you have some experience and javascript; I was hoping you might be able to help out. Here’s the problem:

I’m using two cgi scripts. The form begins with the user having to input his e-mail. After the e-mail is inputted in the form, the first script is called. This script performs a database query and then returns the username, password, and e-mail of the user and then calls the second cgi script. This final script sends the user via e-mail his username and password.

The Problem:
I need to be able to submit a form to the first cgi script without having to use the INPUT TYPE=”submit”. I need to be able to do this because I don’t want the user to be able to see the username and password in the source code.

I’ve read on the Internet that it is possible, but I am unable to find out how it is possible. Any thoughts?
 
Do you really need two scripts?! Could the database query script not then send the details via email, all in the one CGI script?

If not then how about using a submit for the email address, the perl script then does the lookup, writes the output to a file and then explicitly calls the email script with the file as a parameter...

Code:
#we've written username, password, etc to __tmp.txt
system ("myEmailScript.pl __tmp.txt");

Then within the email script after the mail is sent you could display an html page saying done, clear up the temporary file etc...

Just a thought!
Loon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top