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

How do I collect data from a form and print it on a page?

Status
Not open for further replies.

vcherubini

Programmer
May 29, 2000
527
0
0
US
Hello Perl world. I have a question that is really quite basic, but is not working the way that I want it to.<br><br>Ok, I have an HTML form that allows the user to input their name, age, etc.<br><br>Then, when submitted, I have it run through a CGI script (PERL of course) so that the contents can be displayed on a new page.<br><br>I have this as the way to collect the data: <br><br><FONT FACE=monospace> $name = $formdata{'name'};<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$age = $formdata{'age'};<br><br>print &quot;Content-type:text/html\n\n&quot;;<br>print &lt;&lt;EOF;<br><br>&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&lt;TITLE&gt;The contents of your form&lt;/TITLE&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY BGCOLOR=white&gt;<br>Your name is: $name&lt;BR&gt;<br>Your age is: $age&lt;BR&gt;<br>&lt;/BODY&gt;<br>&lt;/HTML&gt;<br>EOF<br><br></font><br><br>Ok, when I run the scrip through the form, all that appears on the page is<br><br>Your name is: <br>Your age is:<br><br>with there being after the words.<br>Can anyone help, could it have to do with my server or code? Is the <FONT FACE=monospace>$formdata{}</font> built in variable out of date and a better one to use?<br><br>Please help.<br><br>Thanks in advanced to anyone who can.<br><br>Vic Cherubini<br>CEO V O I D Interactive
 
If you know enough to figure it out ( you need to know a little) , Lincoln Stein's CGI.pm module is a useful tool.<br><br>I don't see anything wrong with the code you included.&nbsp;&nbsp;I expect you are correctly suspicious of the formdata hash.&nbsp;&nbsp;It must be doing something other than what you think it is, or, the field names from the HTML are other than you think they are.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top