http_referer question

2003-06-26 Thread anthony
Hi, should I use $ENV{HTTP_REFERER} to check wether a form was sent from my site. Because I don't want people to download my webpage, put a link to a form, and modify some of the forms so it can crash the script.(eventough i tried to protect from that). The best way i can think of for the moment i

Clearing Printers w/CGI

2003-06-26 Thread Rob
Hello, I've been trying to write a cgi script that will clear and restart the printers on our server. We have 3 printers that just give me fits running through a Linux server. I have no problem getting everything back up and running on the command line but when I go on vacation the office staff w

Re: http_referer question

2003-06-26 Thread Andrew Brosnan
On 6/26/03 at 10:48 AM, [EMAIL PROTECTED] (anthony) wrote: > Hi, > > should I use $ENV{HTTP_REFERER} to check wether a form was sent from > my site. Because I don't want people to download my webpage, put a > link to a form, and modify some of the forms so it can crash the > script.(eventough i t

Re: Clearing Printers w/CGI

2003-06-26 Thread Kristofer Hoch
Rob, The problem is in the permissions of the user id that is running the script, not the owner of the script. In this case, your webserver is the person running the script. So more than likely, you should use 'clearpq.cgi' to kick off a different script 'clearpl.pl' as ROOT. The script should

Re: http_referer question

2003-06-26 Thread Dennis Stout
> should I use $ENV{HTTP_REFERER} to check wether a form was sent from my > site. > Because I don't want people to download my webpage, put a link to a form, > and modify some of the forms so it can crash the script.(eventough i tried > to protect from that). Enough error handling in your script

Re: http_referer question

2003-06-26 Thread [EMAIL PROTECTED]
I have found CGI::FormBuilder a great way to do the validation for you. First it ignores anything you didn't specifically ask for. Second, you can easily validate using regexes. An additional benefit is that this module provides client side (for legitimate users of your form), and server side check

saving a textarea to a text file

2003-06-26 Thread Bob X
How would I go about saving the textarea of an HTML page to a text file? Bob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: saving a textarea to a text file

2003-06-26 Thread Andrew Brosnan
On 6/26/03 at 10:14 PM, [EMAIL PROTECTED] (Bob X) wrote: > How would I go about saving the textarea of an HTML page to a text file? > use CGI; my $q = new CGI; my $record = $q-param('text_field'); open(OUTFILE, ">output.txt") or die "Can't open output.txt: $!"; print OUTFILE

Re: saving a textarea to a text file

2003-06-26 Thread Camilo Gonzalez
Wrong. Try: use CGI; my $q = new CGI; my $record = $q->param('text_field'); open(OUTFILE, ">output.txt") or die "Can't open output.txt: $!"; print OUTFILE $record; close OUTFILE; Andrew Brosnan wrote: On 6/26/03 at 10:14 PM, [EMAIL PROTECTED] (Bob X) wrote: How would I go

Why should I create an object?

2003-06-26 Thread Greenhalgh David
Bare in mind that I am still a beginner at coding. Why is it "good practice" to create an object when using CGI, rather than just diving in? For example: use CGI ':standard'; my $q=new CGI; my $input=$q->param('input'); and use CGI ':standard'; my $input=param('input'); both put the contents o

Re: Why should I create an object?

2003-06-26 Thread Dennis Stout
> Bare in mind that I am still a beginner at coding. Why is it "good > practice" to create an object when using CGI, rather than just diving > in? Maintainability. > For example: > > use CGI ':standard'; > my $q=new CGI; > my $input=$q->param('input'); > > and > > use CGI ':standard'; > my $input

Re: Why should I create an object?

2003-06-26 Thread Dennis Stout
And if anyone tells me anything about the RequestHandler not being setup to handle random URI's, I'll bite! I'll fix that once I'm reasonable close ot done writing the dispatch table. Eventually this beast will have SQL shoved into it and will begin making database queries. Thank you Randall Sch

Re: slash question

2003-06-26 Thread Nicholas Davey
You could escape them. That usualy works for me. Example: $dir= "\/\/ITC\/home\/techs"; Yes I know how sloppy that looks, but if it works and doesnt matter, why worry bout it? -- www.vadtec.net [EMAIL PROTECTED] "Susan Aurand" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > I

RE: saving a textarea to a text file

2003-06-26 Thread Charles K. Clarkson
Camilo Gonzalez <[EMAIL PROTECTED]> top posted: : : Andrew Brosnan wrote: : : >use CGI; : >my $q = new CGI; : >my $record = $q-param('text_field'); : >open(OUTFILE, ">output.txt") or die "Can't open output.txt: $!"; : >print OUTFILE $record; : : Wrong. Try: Besides the cl