Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Location
    Sunny Western PA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cgi + Html = ???

    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.

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could you some of the code perhaps?

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Dallas
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Some days you are the bug; some days you are the windshield.

  • #4
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Change your html file to shtml and use ssi to call the cgi script like this.

    <!--#exec cgi="/cgi-bin/script.cgi"-->
    WolfPower Script And Programs
    WolfPower


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •