Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sending HTML Page From CGI Using PERL

Posted on 1999-01-21
2
Medium Priority
?
219 Views
Last Modified: 2010-03-05
Hi,
I want to send a HTML page consists of a RadioButton from Cgi.

SOURCE CODE
***********
print "Content-type:text/html/\n\n";
print "<html><head><title>Options</title></head>";
print "<body><form>";
print "<INPUT TYPE="radio" name="but" value="Click">Hello";
print "</form>";
print "</body>";
print "</html>";

If i run this code it gives compiletime error.suppose if i send a page without any components it is working.
0
Comment
Question by:senthil_krn
2 Comments
 
LVL 1

Accepted Solution

by:
ptruman earned 60 total points
ID: 1210225
it doesnt work as you are not escaping your " marks
try :
print "<INPUT TYPE=\"radio\" name=\"but\" value=\"Click\">Hello";

(on one line) and it will work.
OR

print <<MARKER;
Content-type:text/html


<html><head><title>Options</title></head>
<body><form>
<INPUT TYPE="radio" name="but" value="Click">Hello
</form>
</body>
</html>
MARKER

0
 

Expert Comment

by:narayan123
ID: 1210226
replace " by ' in the script,like that:
print "Content-type:text/html/\n\n";
print "<html><head><title>Options</title></head>";
print "<body><form>";
print "<INPUT TYPE='radio' name='but' value='Click'>Hello";
print "</form>";
print "</body>";
print "</html>";

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question