Solved

Sending HTML Page From CGI Using PERL

Posted on 1999-01-21
2
196 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 20 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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…

809 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