Re: CGI for collecting phone numbers



ferreira@xxxxxxx wrote:

Please don't think that I am asking some one to do this for me! I have
spent hours trying to figure out why this simple script won't work.

This is what I have:

The html file:

<FORM ACTION="/sms.pl" METHOD="POST">Cell Number: <INPUT TYPE="text"
NAME="phone"><input type="submit" name="submitButtonName" border="0">
</FORM>


The sms.pl file:

#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
my $file = '/users/web/king/web/sms.txt';
open (FILE, ">>" . $file) or die "cannot open file for appending: $!";
flock (FILE, 2) or die "cannot lock file exclusively: $!";
print "Content-type: text/html\n\n";
print FILE $phone . "\n";
close (FILE) or die "cannot close file: $!";



And a sms.txt file
All of the files are in the same place on the server

The is the error log message:
access:
c-68-35-76-89.hsd1.nm.comcast.net - - [09/Jun/2006:17:28:30 +0000]
"POST /sms.pl HTTP/1.1" 500 -


It is unlikely your webserver is configured to execute files in your
document root. You may have to move it into /cgi-bin or similar, and make
sure it is executable by the webserver (permissions).


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
.



Relevant Pages

  • Re: vulnerability in glocation.cgi?
    ... some odd web accesses to one of my webserver seemingly to exploit ... a vulnerability in a script called "glocation". ... So the harmless looking probes turned up to be much more. ... Ignoring incidents sounds wrong to me. ...
    (Incidents)
  • Re: init.d startup script does not exit
    ... I have a script that launches a program. ... it keeps on running in the shell. ... It is a webserver, so I ...
    (Debian-User)
  • Re: found clues about a security issue in a web server
    ... In the latest week my internet connection was frozen. ... i see this process in my webserver (stored ... That website use php and mysql. ... That security issue happen's by a bad-programmed script code, first of all, ...
    (Security-Basics)
  • Re: ipchains for dummies
    ... A perl script could do the ... > I want to make my internal webserver accessible via a firewall-PC ... > If I want to insert that script into my existing ipchains rules, ...
    (comp.os.linux.security)
  • Re: New worm protection
    ... > tells the webserver that your script will generate ALL of the ... Then the script can just close, ... > Use RewriteRule, not RedirectMatch. ... >> I really don't understand why the Rewrite rule doesn't work as expected. ...
    (FreeBSD-Security)