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> 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> ); print qq (<p> ); print qq (<p> ); 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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |