referer throwing Internal Server Error

2006-03-13 Thread David Gilden
Greetings from Cow Tow! Here is my little script and it throwing a Internal Server Error #!/usr/bin/perl use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use POSIX 'strftime'; use strict; my $referer = referer; if ($referer !~ m|^https?://www\.coraconnection\.com|i) { pr

Preventing unauthorized use of a CGI script

2006-02-06 Thread David Gilden
Greetings, Just wanted hear opinions on how effective this is, as way of preventing email relaying stoping unauthorized use my script. This from a script that connects a page to sendmail #!/usr/bin/perl use CGI qw/:standard/; #..snip.. my $referer = referer; # what page called the scr

CGI Upload Code

2005-12-19 Thread David Gilden
Holiday Greetings, I copied this from a CGI web site, and while it does work, I was wondering what folks with more experience in PERL thought of this code. Thanks for any comments, Dave Gilden #!/usr/bin/perl -w use CGI qw/:standard/; use CGI; use Fcntl qw( :DEFAULT :flock ); use CGI::Carp qw(f

CGI.PM and IF statment....

2005-09-09 Thread David Gilden
The if statement below does not seem to work as expected// Given in the HTML: Choose type message Comment about a recent performance or recording Concert or Event Booking inquiry Personal message and in the perl: #!/usr/local/bin/perl use CGI qw/:standard/; use strict; #and other stuff...

RE: Preventing CPU spikes / was switch confusion

2005-04-13 Thread David Gilden
Dear Perl Gurus, I have some problems that I think are a result of how my Switch statement is written. This script is invoked via a web browser to upload a file, and do a few other things. However it appears that the user system / network, or my script is stalling. So the user clicks the butt

RE: Insecure dependency in glob ... with -T switch

2005-01-17 Thread David Gilden
Hi, The code below works fine if run like: using PERL version 5.00503 #!/usr/bin/perl -w but with #!/usr/bin/perl -wT I am still getting error: Insecure dependency in glob while running with -T switch Can I turn off 'tainting' for this block { # turn off taint for this block only ope

RE: Insecure dependency in glob ... with -T switch

2005-01-16 Thread David Gilden
I thought this would do it, but I am at stopping point: #!/usr/bin/perl -wT my @filesToRemove = map {$_ =~ /^(\w[\w.-]*)/} <*>; Still getting : Insecure dependency in glob while running with -T switch What can I do still have this functionally and satisfy 'tainting' Thanks, Dave tel: 817-

Insecure dependency in glob while running with -T switch

2005-01-16 Thread David Gilden
Last question here, #!/usr/bin/perl -wT Snip ... my @filesToRemove = <*>; The line above is causing: Insecure dependency in glob while running with -T switch What can I do still have this functionally and satisfy 'tainting' Thanks, Dave tel: 817-741-2327 fax: 972-916-3451 (kora

SWITCH / CASE statements

2005-01-16 Thread David Gilden
Quick question here for the PERL gurus! What should be the order for these two statements? exit; last switch; i.e is this correct? Thanks!! Dave -- Ft. Worth __CODE__ SWITCH: { if ($action =~ /Update/) { print redirect("./import_clean_csv.php");

print $q->p(with CSS)

2005-01-16 Thread David Gilden
Happy New year out there, Is it possible to get CGI.pm to print text... I also need to print out the one these as well: but it has to be in the of the starting HTML? -- and I would like it before the and after the Is any of this possible and would be the correct syntax for this? Belo

untainting data

2004-11-10 Thread David Gilden
Hello, Is the following all I need to untaint data? #!/usr/bin/perl use CGI qw/:standard/; my $name = param('name'); $name =~ s/(\w+)/$1/; What can I do limit string length to 40 characters? Thanks, Dave (kora musician / audiophile / webmaster @ www.coraconnection.com / Ft. Worth, TX

reading in a CVS file

2004-11-02 Thread David Gilden
Hello, I am trying to do an import of a Tab De-limited file and then extract certain fields. I am looking to general comments and or a better more concise way of doing this, Thanks in advance... Dave Gilden -- Ft. Worth-less Texass Here is what I have so far (and it is not tested and my be inc

Re: CGI.pm unsecure / dangerous ?

2004-02-24 Thread David Gilden
Sx- Jones. > Yes, this script can be hijacked =/ Sorry. > > > > print MAIL "TO: [EMAIL PROTECTED]"; > > print MAIL "From: $name <$email>\n"; > > print MAIL "Subject: $subject\n\n"; The From is Hard wired so I donât understand you mention below. print MAIL "From: $name <$email

CGI.pm unsecure / dangerous ?

2004-02-24 Thread David Gilden
I just had blow up with a sys. adm. who said my script (see below) is potentialy unsecure and dangerous and therefor unacceptable. They are going with this one :) note the line from my script: print MAIL "TO: [EMAIL PROTECTED]"; Is there away some

CGI form button w/ images

2003-10-06 Thread David Gilden
Hello, Question concerning forms, I have buttons of the type: But I would like to use a button of type: The problem is I need to pass values from the hidden fields to the script. with the any suggestions? Thanks, Dave ( kora musician / audiophile / web master @ cora connection / Ft. Wo

Send mail weirdness

2003-10-02 Thread David Gilden
Greetings, my client claims he never receives any email from his contact page! I however have set up a 'BCC' and am getting email via the script below. His connection to the 'net is via AOL, and when I mail him from my email client using [EMAIL PROTECTED] he receives it, but not from the script

POSIX 'strftime' and time zones

2003-09-30 Thread David Gilden
Quick question, the server is on west coast time (California) client is in Texas, central time (+2 hours) How can I add two hours to offset for central time? Thx, Dave #!/usr/local/bin/perl use POSIX 'strftime'; my $date = strftime('%A, %B %d, %Y %I:%M %p',localtime); print $date; -- -- To

calling other cgi's in PERL

2003-09-29 Thread David Gilden
Can anyone enlighten me on how to do this: Goal: call different PERL scripts from current PERL script. Below is what I am trying to accomplish, but I am not sure I have the syntax correct. (can't seem to find anything this in my PERL books) Thanks, Dave - #!/usr/bin/perl -w #some code..

SQL -- getting one row problem -- clever mySQL trick

2003-09-29 Thread David Gilden
Hello out there... I wanted to thank everyone who has kindly offered their assistance with my current project. Of course I have more questions, But first I wanted to share how I solved my current issue. It's displays a clever mySQL trick! -- see script below: Dave Gilden ( kora musician / audiop

SQL -- getting one row problem

2003-09-29 Thread David Gilden
Good afternoon, Here is the output of my script, and can’t understand why this is not working. Thanks for any and all pointers! Dave Gilden [EMAIL PROTECTED]:~/cgi-bin$ mail_guest_to_jk.cgi Use of uninitialized value in concatenation (.) or string at ./mail_guest_to_jk.cgi line 33. Use of uni

SQL question escaping quotes

2003-09-27 Thread David Gilden
One final question here on my SQL -- PERL DBI the following is wrong -- it does not work ! $sql = qq|insert into $table_name values (null,now(),"$email","$name","$comments");|; $sql = $dbh->quote($sql); ## this line $sth = $dbh->prepare($sql); if I do this: $name = $dbh->quote(param('Name'));

SQL question // date_format

2003-09-27 Thread David Gilden
Good evening, The following mySQL query works fine, but the server is in California. I would like add 2 hours to %l, because the client is in Texas. I could just go to time in GMT and forget about it :) But I'm wondering if there is a simple solution here. "SELECT id, DATE_FORMAT(datecreated, '

radio buttons :: CGI.pm

2003-09-27 Thread David Gilden
Good evening, How would I write the following with having to create %sort_order HASH? Thanks, Dave -- FT Worth, Tx snip %sort_order = ( 0 => ' Newest --> Oldest ', 1 => ' Oldest --> Newest ', ); print radio_group( -name=> 'database_order', -values => [

HTML headers with CGI.pm

2003-09-24 Thread David Gilden
Hello, Having some issues with cgi.pm Here is my PERL: ### # Start HTML OUT ### print header; print start_html( -title => $title ); print qq|\n|; and here is the output: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/199

guestbook mySQL deleting and refreshing

2003-09-24 Thread David Gilden
Helllo, Here is part two: Goal: delete selected records and refresh display_guestbook.cgi page. So the users sees the changes made. Please let me know how I can Improve my script and if you see anything that is bad style/practice. Thanks in advance for the lists help this code, Regards from

guestbook mySQL / PERL

2003-09-24 Thread David Gilden
Helllo, I have some questions here about my code. (which is going to have some issues) I am going to send this as 2 emails so that you don't have to scroll endlessly :) Goal: display database in a table with checkboxes so that the user can delete selected messages Please let me know how I c

Guest Book design / mySql / perl

2003-09-19 Thread David Gilden
Hello, I am taking over a site that was on a M$ server and redoing the Guest book and form pages in PERL. Question I have is the design of database. I have the following fields: Name varchar(80) Date date email

Re: Script for random images -- problem

2003-08-01 Thread David Gilden
quot;\nNEW:$2"; ... snip. print redirect("$2/$lucky_one"); So I did see the problem you mention below!! Oliver Schnarchendorf <[EMAIL PROTECTED]>, > On Thu, 31 Jul 2003 17:58:43 -0500, David Gilden wrote: > > $PICTURE_PATH = path_translated(); > > $PICT

Script for random images -- problem

2003-07-31 Thread David Gilden
Hello, I am getting the following error --> Software error: Couldn't chdir to pictures directory: Not a directory at /home/sites/site175/web/cgi-bin/rand_img.cgi line 11. Is there setting on Apache that I need to enable so this script will work? Thanks, Dave Gilden #!/usr/bin/perl # http://

Earth Link settings for PERL & Sendmail

2003-03-31 Thread David Gilden
FYI: After 1/2 hour on the phone with tech support here's some info that I hope will help others! #!/usr/local/bin/perl my $mailprog = '/usr/lib/sendmail'; # the real path to sendmail # seems to vary depending on the type of account

CGI.pm script not working

2003-03-31 Thread David Gilden
Greetings, I have uploaded the following to a UNIX server at Earthlink, and it is returning a 500 Internal Server Error. Is my script at fault? Thanks, Dave ( kora musician / audiophile / web master @ cora connection / Ft. Worth, TX, USA) #!/usr/bin/perl -w use CGI qw/:standard/;

CGI.pm

2003-03-25 Thread David Gilden
Good afternoon, a few quick questions pertaining to CGI.pm: How can I get CGI.pm to return lower case tags. print end_html; # prints Upper Case is there something I can add locally to my script or do I have to send a request to my ISP? How would tell what version I have running at my account?

regrex question part 2

2003-03-20 Thread David Gilden
In the following why am I getting '23' Is 23 being treated as a string? #!/usr/bin/perl -w use strict; my $s = ' 23 one two three'; $s =~ s/(\w{1,10}).+/$1/; print $s; --- my $s = 'one two three'; $s =~ s/(\w)/$1/; print $s; Returns 'one two three', I was looking for it to match 'on

regrex question

2003-03-20 Thread David Gilden
good afternoon, I am trying to get the following as a result: xxx9988 #!/usr/bin/perl -w $card_number = '123456789988'; $card_number =~ s/\d{8}(\d{4})/x'x'8 . $1/e; # not working print "$card_number\n"; Is there a clever trick using tr =~ or something similar? Thanks! Dave -- To

anonymous hash clarification

2003-03-15 Thread David Gilden
Thanks Dan and the rest of the list for helping hone my PERL skills. Below is the data structure I am using, I think it is a HoH -- Hash of Hash Did get that right ? :) > Well 'better and correct' depends on what your design says, we cannot > tell that. They are doing different things, that I c

Re: Sending JavaScript variables to a perl program

2003-03-15 Thread David Gilden
Hwo about this: Desired result: Departure Date What is wrong the above regrex? Thanks! Dave ** * Cora Connection Your West African Music Source * * http://www.coraconnection.com/

removing white space

2002-02-14 Thread David Gilden
Is this correct, I want to remove leading and trailing white space, Thanks Dave -- foreach $item (param()) { my $value = param($item); $value =~ s/^\s+//; $value =~ s/\s+$//; } better?? foreach $item (param()) { my $value = param($item); $value =~ s/^\s+(.*)\s+$/$1/; } -

where to rename a file in this sub?

2002-02-14 Thread David Gilden
Hi, Am not sure where I should be renaming the $emailLog file in this sub, Am I on the right track? Thanks Dave sub addEmail{ my $emailLog = '/email_list/email_list.txt'; # append new email open(EL,">>$emailLog") || die "Problem: Could not append to $emailLog, $!"; print EL "$email ($realna

redirect script failling

2002-02-13 Thread David Gilden
Can someone point why the following is not working? Thanks Dave G. #!/usr/bin/perl -w use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use POSIX 'strftime'; $which_button = lc(param('submit')); print header; print $which_button; if ($which_button eq "continue to next section") {

Date Functions

2002-01-31 Thread David Gilden
Hi, I am updating an old Script. Are there any problems or 'Y2k' bugs, in the following change? Thanks, Dave #!/usr/bin/perl use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use POSIX 'strftime'; # NEW -- replaces the block below $date = strftime('%A, %B %1d, %Y %I:%M %p',

CGI.pm problem

2002-01-16 Thread David Gilden
Hello, Here is what I am trying to do, In my html etc I Have several buttons, that display the label 'Class Schedule' I want to use the 'name' as data. So in my CGI code (perl): $class_to_display = param('kayaking_intro'); $class_to_display = param('white_water_intro');

RE: Dynamic html/frames frm PERL not working

2001-12-11 Thread David Gilden
Duh, I found the problem, Perl comment was in side of the 'here' doc script works fine now, Dave # HTML Page out print header; print Frame Setter for \u$pageName old code with mistake print header; print

Dynamic html/frames frm PERL not working

2001-12-10 Thread David Gilden
Could someone point out why the CGI script below does not work? Thanks, Dave The CGI (shown below) is used to create a frameset.html file. http://dowda.rockin.net/final/ Click on one of the left menu choices, ( using Netscape ) This is what the hrefs look like: Intro Another File... This work

CGI.pm ".cgifields"

2001-11-12 Thread David Gilden
What is causing CGI.pm to generate the following? There no print statements for hidden fields!!! Thanks, Dave # in my script --- use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); # later in the code checkbox( -name =>$gig_num, -checked =>0, -label=>' ' ,override=>1) # removing

rename((1,2) and file permissions

2001-11-09 Thread David Gilden
Hello, what is causing the renamed file to take permissions of 755 instead of 644? -- am I doing this correctly -- there will be only one user of the script .. do I need 'file lock' here? Thanks to Bob Showalter for the formatting info on 'strftime' "man 3c strftime" --> http://www.cs.princeto

redundant code

2001-10-31 Thread David Gilden
Good afternoon, Can some one point out where I am off? use CGI qw/:standard/; @fields = param(); # I think it returns a list of all the fields, # maybe we want to inslist a hash to get the values. foreach (@fields){ if ( $_ ~= /(|\?+|\d)/ ) { # match "" or ??? or 0 # do something bl

Cookie help needed

2001-10-30 Thread David Gilden
The code below does seem to work, and someone please show where I went wrong. Thx Dave -- ### Set Cookie #!/usr/bin/perl -w use CGI qw/:standard/; my $new_cookie = cookie( -name => "bears", -values => ['Sweater','Seymore','Bearnard','Blondie'], ); pri

RE: CGI.pm hidden field problem

2001-10-17 Thread David Gilden
Thanks! On Wednesday, October 17, 2001 at 3:40 PM, [EMAIL PROTECTED] (Bob Showalter) wrote: > > print "\n"; > > print hidden( > > -name => last_message_num, > > -value => $message_num, > > # -override=> 1 > > ); This works! > > Try this: > >param('last_message_num', $message_num); >

RE: CGI.pm hidden field problem

2001-10-17 Thread David Gilden
Still can't get it to wrk! Do a view source, http://dowda.rockin.net/cgi/sqlguestbook.cgi It just ain't working no mater what I try! Lincoln Stein's CGI.pm book says that you can use default,value or values interchangeably. D. On Wednesday, October 17, 2001 at 1:04 PM, [EMAIL PROTECTED] (

CGI.pm hidden field problem

2001-10-17 Thread David Gilden
Hello, I am taking a stab at a SQL driven guest-book, the problem is with getting the field to take the value of $message_num, (see the end of this script) I can see it in the ok, but not in the hidden field (I have tried with override and with out -- not sure what this is for!) I welcome a

re: passing prams to a sub vers a if() block

2001-10-08 Thread David Gilden
Folks, Sorry about the earlier post, perhaps another newbie might get some benefit from this posting :) Here is part of the revised code without the if{} block. To see the exercise I have been working on point your browser to: http://dowda.rockin.net/cgi/sql_sort3.pl It does point another issu

passing prams to a sub vers a if() block

2001-10-08 Thread David Gilden
Hello, Is there a better way of setting up the sort that happens in sort_name(), the 'if( .. )' looks a little verbose, I was thinking it would be better to just past a string, as in: sub sort_name() { my ($first_field,$second_field) =@_; $database{$a}{"${first_field}_name"}; $database{$

Getting Stared with CGI.pm

2001-10-07 Thread David Gilden
Good afternoon, This is my first shot at using CGI.pm (using the function-oriented style). I can't seem to get my script to read values from my web page. http://dowda.rockin.net/cgi/sql_sort2.pl Here is part of the script. Your comments are welcome. Special thanks to [EMAIL PROTECTED] (Curtis Po

javascript and perl/cgi

2001-06-06 Thread David Gilden
Hi, In the following: Name: Email:   Type your chat message Thanks for any pointers on these two issues, Thanks Dave ** * Cora Connection Your West African Music Source * * http://www.coraconnection.com/

Re: A good book? Upgrade

2001-06-04 Thread David Gilden
from : Oreilly, We do have an Upgrade Policy, I'm happy to say. :) You may read about it at http://www.oreilly.com/order/upgrade.html . (http://www.oreilly.com/catalog/pperl3/desc.html) has written: "This third edition of Programming Perl has been expanded to cover version 5.6 of this maturi