Solved

Sending HTML Page From CGI Using PERL

Posted on 1999-01-21
2
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: 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

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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

726 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