I'm trying to write a CGI script that emails a user,
displays on a screen in HTML that they received the
email and writes to a log file. When I enter the data
and click on the button nothing happens. I'm highly
confident that my HTML cod is correct. It looks like this:

<form method=POST action='http://learneasymoney.com/cgi-bin/msgout.cgi +'> <b><font face="arial" size=5 color="#ffffff"> Name: <input type="text" name="fullname" size=35><br> &nbsp;eMail: <input type="text" name="email" size=35> </b></font> <input type="hidden" name="subject" value="PPC Traffic & Profits Machi +ne Info"> <input type="hidden" name="owner" value="admin@learneasymoney.com"> <input type="hidden" name="product" value="PPC Traffic & Profits Machi +ne"> <input type="hidden" name="info" value="PPC marketing and how to make +great money with it."> <p align="center"><button type="submit" name="submit" background="#fff +f00" style="font:24pt Arial Black; color:#0000FF;">Get It Now!</butto +n></p> </form>

I reduced the CGI code to this:

#!/usr/bin/perl -wT use strict; use warnings; use CGI ':standard'; open (LOG, "http://learneasymoney.com/logs/optin.txt") || Error('open' +, 'file'); print LOG "This is a test"; close (LOG); print "Content-type: text/html\n\n"; print qq (<html><body bgcolor='#0000FF'>); print qq (<p>&nbsp;); print qq (<p>&nbsp;); print qq (<p>&nbsp;); print qq (<p align='center'>'Hello All!'); print qq (</body></html>); sub Error { print "Content-type: text/html\n\n"; print qq (<html><body bgcolor='#FF0000'>); print qq (<p align='center'>The server can't $_[0] the $_[1]</p>); print qq (<p align='center'>$!</p>); print qq (</body></html>); exit;

The cgi-bin directory and msgout.cgi file permissions are both set to 755.

So what could be going wrong?

(I noticed a couple of red plus signs in my question when I clicked on 'preview'.
When I went back and checked it out, I couldn't find why this was happening).


In reply to Nothing is happening in my CGI code. by bgatto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.