Sending HTML Page From CGI Using PERL

Posted on 1999-01-21
Last Modified: 2010-03-05
I want to send a HTML page consists of a RadioButton from Cgi.

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.
Question by:senthil_krn
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

Accepted Solution

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.

print <<MARKER;

<INPUT TYPE="radio" name="but" value="Click">Hello


Expert Comment

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>";


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
Removing file extension within a file. 4 103
Rename file based on contents in the file? 3 102
Perl modules on linux ec2 3 123
quoting a comma separated list 20 91
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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…

733 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