Transferring data from page to page

admin

Administrator
Staff member
How do I get data to go from one page to another?<br />
<br />
For example, I am asking the user for information on one page, and then the next page performs a few calculations and then acts as a results page.<!--content-->There are several programming languages that you can use to collect and manipulate the data entered in a form on the first page. The only one I have any knowledge of is ASP. Here is a basic example:<br />
<br />
form.html:<br />
<br />
<form name="request" method="post" action="request_form.asp"><br />
<table width="60%" border="0" cellspacing="0" cellpadding="0"><br />
<tr> <br />
<td width="36%">What is your name?</td><br />
<td width="64%"> <br />
<input type="text" name="name" size="30"><br />
</td><br />
</tr><br />
<br />
<tr> <br />
<td width="36%">What is your email address?</td><br />
<td width="64%"><br />
<input type="text" name="email" size="30"><br />
</td><br />
</tr><br />
<tr><br />
<td width="36%">&nbsp;</td><br />
<td width="64%"><br />
<input type="submit" name="Submit" value="Submit"><br />
</td><br />
</tr><br />
</table><br />
</form><br />
<br />
<br />
form.asp:<br />
<br />
<html><br />
<title>Request Response</title><br />
<body bgcolor="#ffffff"><br />
<font face="arial" size="3"><br />
<br />
Thanks you for completing the request form.<br />
<br><br />
<br><br />
Your name is <% =Request.Form("name") %><br />
<br><br />
<br><br />
Your email address is <% =Request.Form("email") %><br />
<br><br />
<br />
</font><br />
</body><br />
</html><br />
<br />
In this simple example the asp file is accesing information that was entered in form.html and displaying as part of the results page.<!--content-->Thanks Jeni. I am glad it can be that simple because whenever I ask about forms, people just go on about Perl and CGI. I mean, I know C++, but I have only been doing HTML for about a month and would really struggle with doing something in tandem right now.<br />
<br />
Do I need a program to create and write the .asp code?<br />
<br />
Or can I do it on the cheap in notepad?<!--content-->For a tutorial on ASP try here:<br />
<!-- m --><a class="postlink" href="http://www.w3schools.com/asp/default.asp">http://www.w3schools.com/asp/default.asp</a><!-- m --><br />
<br />
You can write it any text editor such as notepad but you must make sure that your server is configured to run ASP code.<br />
<br />
The example I gave was only very simple and obviously it can get a lot more complicated than that, but you can do some pretty nice things with just basic ASP.<!--content-->Thanks Goldilocks (got it right this time - D'Oh!!)<br />
<br />
When you say the server must be able to run ASP, there may be a problem there. There is no server with this site.<br />
<br />
I am just developing a simple tool for engineers, and HTML is quick and cheap to do it in (when you know how, anyway). This will be a complete isolated site where all the files necessary are kept with the page as it goes on a CD - can I do this? Or does it have to be run on a webserver?<!--content-->Aaahh...now someone may have to correct me but I don't think you can process forms in any way without it running on a server. I am quite new to all this myself so if anybody wants to disagree with me feel free but I am pretty sure that you have to have the site running on a webserver.<br />
<br />
Unless... I'm getting out of my depth here but instead of using a serverside language, maybe you could use Javascript to process the form. Javascript is executed by the browser so no server is needed. I suppose it depends what you are wanting to do with the data.<br />
<br />
Hopefully somebody else can help you out a bit more...<!--content-->It doesn't need to go back into a database or anything, so I think that I can get away with a Client-Side Script.<br />
<br />
I'll post when I find out if it works or not.<!--content-->ASP cannot be used in the manner in which I wanted. It requires IIS (Internet Information Services), or PWS (both for Windows), or something, to be installed before it can be used.<br />
<br />
Unfortunately, these are options to the standard install, and in the case of NT4 require a bit of jiggling as it is in the Options pack, and not the OS installation at all. <br />
<br />
Guess its all down to Javascript then. I wonder if I can just post the data to another HTML page with the scripting in that one?<!--content-->If it is just a case of passing data entered on one page to another then I am 99.9% certain that you can do it with Javascript.<br />
<br />
Unfortunately the little Javascript I knew is very rusty so I don't think I can help you. You might want to try asking in the Client-Side Scripting forum where somebody a bit more knowledgable than me is likely to see it.<br />
<br />
Good luck! ;)<!--content-->Okay, thanks Goldilocks.<!--content-->
 
Back
Top