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!

pass variables from one script to another

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello!
I have an HTML page that when the user presses the submit button the variables are stored in the database, and the script creates some textareas. When the user presses the submit button at this one, the values from the textareas are stored in the database, but the thing is that I want to also store one variable from the HTML page. At the moment what I do is to open the database, select that variable and then store it where I want to. The problem is that because it does not exist at the script, I cannot write an SQL condition so that to select a different one every time, but instead it is always the same as the first one that I have stored.

Has anyone got any idea how I could solve this problem? :-(
 
There are two simple ways to solve this problem.
1) cookies
set cookies with information you want to pass from one page to other

2) hidden fields
store information in hidden fields, which can be accessed on submit

 
My html code is as follows:
<html>
<head>
<title>Create Exam Tests</title>
</head>

<h2><center>Exam Tests</center></h2>
<hr>
<h3>Please enter the details of the exam test you wish to create:</h3>
<br>
<br>
<form method=&quot;post&quot; action=&quot;
Module Name: <select name=&quot;module&quot;>
<option>select module
<option>CT 437 Distributed Systems
<option>CT 438 E-Commerce
<option>CT 413 Industrial Applications
<option>CT 412 Research and Professional Development
<option>CT 431 Business Object Technology
<option>CT 434 Computer-Supported Cooperative Work
<option>CT 487 Computer Security and Cryptography
</select>
<br>
<br>
<p>Please enter how many questions you want to include: <input type=text Name=questions Size=10></p>
<br>
..........................
<p><input type=&quot;submit&quot; wrap=hard value=&quot;Submit&quot;>
<input type=&quot;reset&quot; value=&quot;Reset&quot;></p>

</form>
</TABLE>
</body>
</html>

The value that I want to pass to the script is the 'module', which is a pop-up menu. How can I create a hidden field for this one?

Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top