spewn
Programmer
- May 7, 2001
- 1,034
i currently use this to generate HTML page via .pl:
index.pl
which works great...but how do i execute perl commands/scripts in an .html file?
something like:
index.html
but of course, this won't work. the server can't interpret the perl because it's not a .pl, it's a .html type file...
any ideas?
- g
index.pl
Code:
#!/usr/bin/perl
use CGI qw(:standard);
use DBI;
use CGI::Session;
$cgi = new CGI;
$sid = $cgi->cookie("CGISESSID") || undef;
$session = new CGI::Session(undef, $sid, {Directory=>'C:\Temp'});
$cookie = $cgi->cookie(CGISESSID => $session->id);
$sSid = $session->id();
$a = param("a");
$b = param("b");
$c = param("c");
if (!$a) {$a='home';}
print $cgi->header(-cookie=>$cookie);
print << "EOF";
<html>
<head>
<title></title>
</head>
<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>
</body>
</html>
EOF
which works great...but how do i execute perl commands/scripts in an .html file?
something like:
index.html
Code:
<html>
<head>
<title></title>
</head>
<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>
EOF
if ($x eq 'test') {print "test";}
print << "EOF";
</body>
</html>
but of course, this won't work. the server can't interpret the perl because it's not a .pl, it's a .html type file...
any ideas?
- g