Hi there,
I am fairly new to CGI/PERL (so much so, I haven't yet worked out what the difference is). I have some moderate c, pascal and javascript experience, and am at the beginnings of learning CGI/PERL. I have a CGI problem which I am hoping someone will be kind enough to help with.
The CGI script I am using was downloaded from a library so I don't really have a good understanding of how or why it works. In short, I am having trouble taking data from an html form and getting my CGI script to write that data to another html page. I realise that this is probably quite a trivial issue for most of you great people so I do really appreciate the assistance. I will try to be as clear as I can:
Here's the HTML page that calls the script:
<html>
<head>
<title></title>
</head>
<body>
<form method="POST" action=" <p>Name: <input type="text" name="name" size="20"><br>
Address: <input type="text" name="address" size="20"><br>
<input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset"
name="Reset"></p>
</form>
</body>
</html>
I assume the following is the CGI script code that reads the data in from my form page:
--begin--
$cl = $ENV{'CONTENT_LENGTH'};
if ($cl > 0)
{
read(STDIN, $_, $cl);
$_ .= "&";
-end--
The CGI script is then supposed to write my form data to a new html page. I do not have any problem getting the new page to display, I just can't get it to display the values that were taken from my form page.
I have tried including the following code in my CGI script, in the hope that one or versions will work (but neither will):
--begin--
name = $name<br>
name = $c1{'name'}<br>
address = $address<br>
address = $c1{'address'}<br>
--end--
Unfortunately, all my new page displays is:
--begin--
name =
name =
address =
address =
--end-
Why won't the values display? I am slowly going mad, because I'm sure that it's quite simple. I have spent countless hours searching for the answer - but it has all been in vain. I have turned to you in the hope that some good person will put me out of my misery.
Many thanks,
Robert [sig][/sig]
I am fairly new to CGI/PERL (so much so, I haven't yet worked out what the difference is). I have some moderate c, pascal and javascript experience, and am at the beginnings of learning CGI/PERL. I have a CGI problem which I am hoping someone will be kind enough to help with.
The CGI script I am using was downloaded from a library so I don't really have a good understanding of how or why it works. In short, I am having trouble taking data from an html form and getting my CGI script to write that data to another html page. I realise that this is probably quite a trivial issue for most of you great people so I do really appreciate the assistance. I will try to be as clear as I can:
Here's the HTML page that calls the script:
<html>
<head>
<title></title>
</head>
<body>
<form method="POST" action=" <p>Name: <input type="text" name="name" size="20"><br>
Address: <input type="text" name="address" size="20"><br>
<input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset"
name="Reset"></p>
</form>
</body>
</html>
I assume the following is the CGI script code that reads the data in from my form page:
--begin--
$cl = $ENV{'CONTENT_LENGTH'};
if ($cl > 0)
{
read(STDIN, $_, $cl);
$_ .= "&";
-end--
The CGI script is then supposed to write my form data to a new html page. I do not have any problem getting the new page to display, I just can't get it to display the values that were taken from my form page.
I have tried including the following code in my CGI script, in the hope that one or versions will work (but neither will):
--begin--
name = $name<br>
name = $c1{'name'}<br>
address = $address<br>
address = $c1{'address'}<br>
--end--
Unfortunately, all my new page displays is:
--begin--
name =
name =
address =
address =
--end-
Why won't the values display? I am slowly going mad, because I'm sure that it's quite simple. I have spent countless hours searching for the answer - but it has all been in vain. I have turned to you in the hope that some good person will put me out of my misery.
Many thanks,
Robert [sig][/sig]