...

View Full Version : Cgi + Html = ???



horrorcollect
08-05-2002, 08:10 PM
Hi guys - ok, i have a great HTML page laid out on Dreamweaver called "auction.htm". I also have a great CGI auction script all working and ready to go called "auction.pl".

my auction.html page has a table simply waiting to have the cgi auction script put in to it. how do i do this? do i apply the cgi script to the html document? or do i put in my html into my Perl cgi script???

in other words, my entire website has the same layout, with a header, footer, and the links on the left-hand side.... and the main content in the center (like most webpages). but i cant figure out how to get a cgi script inside of HTML.

please help.... thanks,

keith t.

Mouldy_Goat
08-06-2002, 12:51 PM
Could you some of the code perhaps?

amy2go
08-13-2002, 04:19 PM
I would put your html inside your perl script like this:

print <<"HTML";

<html>
<head>
<body>
</body>
</html>

HTML

Remember that this is very picky...there should be no space between the << and the "HTML", and the HTML marker should be unquoted and at the beginning of an empty line; no other code is allowed on this line, including the end-of-file marker and semi-colon. If it is on the last line of your program, there must be a carriage return. (Be sure to include the content-type). What this does is interpolates the perl variables used as if the entire section was in double quotes. So you can have <td>$perlVariable</td>. You can use this over and over:

#perl script

print <<"HTML";

html stuff

HTML

#perl script

print <<"HTML";

html stuff

HTML

wolfpower
08-18-2002, 12:29 AM
Change your html file to shtml and use ssi to call the cgi script like this.

<!--#exec cgi="/cgi-bin/script.cgi"-->



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum