#!C:/Perl/bin/perl.exe
# Simple Browser Identification
$browser = "$ENV{'HTTP_USER_AGENT'}";
# Declare Variables
$adrevenue;
$weePit;
$adrevenue = 1000;
$weePit = 'weeCrackPit';
print "Content-type: text/html\n\n";
print "<html>";
print "<head>";
print "<title>Simple Browser Checker</title>";
print "</head>";
print "<body>";
print "You are using $browser to view these pages!\n";
print "<br />";
print "<a href=\"www.crmpicco.co.uk\">Go to Picco\'s Site</a>";
print "<br />";
print "The revenue from the pages are $adrevenue";
print "<table>";
print "<tr>";
print "<td>";
print "Wee Pit is a $weePit";
print "</td>";
print "</tr>";
print "</table>;
print "</body>";
print "</html>";
ENDHTML;
this is my error is am getting:
==========================================
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Bareword found where operator expected at c:\inetpub\wwwroot\picco\browserCheck.pl line 34, near "print "
==========================================
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
thanks Charles, i never noticed that. how does the HEREDOC syntax work? Is that the <<ENDHTML code????
Yes. It looks like you started using it but abandoned the idea. You've the closing "ENDHTML" but not the opening.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
I'm getting this error now....
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Can't find string terminator "ENDHTML" anywhere before EOF at c:\inetpub\wwwroot\picco\browserCheck.pl line 15.
========================================
Code:
#!C:/Perl/bin/perl.exe
# Simple Browser Identification
$browser = "$ENV{'HTTP_USER_AGENT'}";
# Declare Variables
$adrevenue;
$weePit;
$adrevenue = 1000;
$weePit = 'weeCrackPit';
print "Content-type: text/html\n\n";
print <<ENDHTML;
print "<html>";
print "<head>";
print "<title>Simple Browser Checker</title>";
print "</head>";
print "<body>";
print "You are using $browser to view these pages!\n";
print "<hr>";
print "Hello and Welcome to My Page user from $ENV{'REMOTE_HOST'}\n";
print "<br />";
print "You came from $ENV{'HTTP_REFERER'}"
print "<a href=\"$ENV{'HTTP_REFERER'}\">";
print "Return to the page you were last at.</a>\n";
print "<a href=\"www.crmpicco.co.uk\">Go to Picco\'s Site</a>";
print "<br />";
print "The revenue from the pages are $adrevenue";
print "<table border=\'1\' bordercolor=\'#000000\'>";
print "<tr>";
print "<td>";
print "Wee Pit is a $weePit";
print "</td>";
print "</tr>";
print "</table>";
print "</body>";
print "</html>";
ENDHTML;
Try ENDHTML and not ENDHTML;. I'll admit, my Perl here-doc synatax is a bit rusty.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
1. By keystrokes you mean how much code is in the script?
3. CGI.pm, i am presuming that is a downloadable Perl module. Also, i have seen CGI referred to alot, how does it differ from Perl and what advantages does it have?
#!C:/Perl/bin/perl.exe
# Simple Browser Identification
$browser = "$ENV{'HTTP_USER_AGENT'}";
# Declare Variables
$adrevenue;
$weePit;
$AgePicco;
$AgeSmacker;
$adrevenue = 1000;
$weePit = 'weeCrackPit';
$AgePicco = 22;
$AgeSmacker = 22;
$CombinedAge = $AgePicco+$AgeSmacker;
print "Content-type: text/html\n\n";
print <<ENDHTML
<html>
<head>
<title>Simple Browser Checker</title>
</head>
<body>
You are using $browser to view these pages!\n
<hr>
Hello and Welcome to My Page user from $ENV{'REMOTE_HOST'}\n
<br />
You came from <a href=\'$ENV{'HTTP_REFERER'}\'>THIS PAGE</a>\n
<br />
<a href=\"www.crmpicco.co.uk\">Go to Picco\'s Site</a>
<br />
The revenue from the pages are $adrevenue
<table border=\'1\' bordercolor=\'#000000\'>
<tr>
<td>
Wee Pit is a $weePit
</td>
</tr>
</table>
<div>The combined age of C and B is $CombinedAge</div>
</body>
</html>
ENDHTML
Superb!! That is my script after adding the <<ENDHTML and all the needless 'print' commands, if you can have a <<ENDHTML command and just write the script like a HTML page then why is there a great need for the print command???
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
"ENDHTML " is not a command. You can use aything that you like with the "<<" operator.
Code:
#!C:/Perl/bin/perl.exe
print <<athanasius
Content-type: text/html
Whosoever will be saved, before all things it is necessary that he hold the Catholic Faith.
...
This is the Catholic Faith, which except a man believe faithfully, he cannot be saved.
athanasius
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Bookmarks