in reply to Re: Perl and HTML
in thread Perl and HTML

Ok, sorry, no one has the right idea. I don't want to call a html page from a cgi script. I want to call a cgi script from a HTML page. It's a short script. it does 2 things. when the user views my index.html page. the cgi script runs. It checks for to cookies. if it finds them, it says welcome back user. if it doesn't it then displays a form, so if they wanted to. they couls sign. or some thing lime that.

Replies are listed 'Best First'.
Re^3: Perl and HTML
by jeffa (Bishop) on Jul 06, 2005 at 19:54 UTC

    Do yourself a big favor and read this: Ovid's CGI Course. It will help you understand how to work with CGI and HTML. If you want some example code that uses cookies, try these two nodes: 273481 and 273652. Just copy the code verbatim into a CGI script that can be executed by the web server. If that didn't make sense, then you need to read that first link. It will help.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      I already know how to use,set, and read in cookies. I just asked a simple question, why can't I get a simple answer. HOW do I run an cgi script from an HTML page.

        I just have a simple question, why can't I get a simple answer. HOW do I eliminate the US Federal deficit?

        The reason why you can't get a simple answer is because you're not asking the question you really have. I think that you think that perl can be used like Javascript. That you can have some HTML file with perl embedded in it some way (like Javascript, which can be inline, or included, or both).

        All respondants thus far already know you can't do that. Which is why they are presuming that you aren't asking how to do the impossible, or they are offering helpful advice on how to accomplish the same thing, but in a way that actually works. A simple "no, you can't do that," while correct, is not helpful, and, generally speaking, monks around here are helpful to a fault, tripping over each other to get those votes and experience points. (Or maybe just for the satisfaction of being first - not that the motivation behind being helpful is really that important.)

        So you're getting many options available to you to actually accomplish what you want to accomplish, it just isn't doing this the way you think it should be done because you can't do it that way.

        Monks often read much into questions to try to make sense of the question to be able to offer a helpful answer. Be glad they do - they're giving you very good advice. Try it out.

        Just because there's more than one way to do it doesn't mean that every way is a way to do it.