Final IP ban subroutine.

2003-05-27 Thread Sara
{ chomp($line); ($ipban,$subject) = split(/\|/,$line); next unless $ipban eq $current_ip; &error(bad_ip); last; } #### SECOND: I have just started using CGI.pm, its probably my second or third script using CGI.pm and I have no idea how to split the IPban.txt and put the variables IPs and Subject line like this: $ipban | $subject Currently I am getting the output like this: $ipban see the make_form; subroutine above. Thanks for any input, for integrating the subject line in already existing script for banning IPs of BBS. Thanks, Sara.

Looking for form mail attachment script.

2003-05-31 Thread Sara
I am looking for a pre-written CGI Form script, which is capable of sending mails with attachment from my desktop etc. I have seen an example of this script sometimes back in the group. Any ideas? TIA, Sara.

Looking for form mail attachment script.

2003-05-31 Thread Sara
I am looking for a pre-written CGI Form script, which is capable of sending mails with attachment from my desktop etc. I have seen an example of this script sometimes back in the group. Any ideas? TIA, Sara.

require "config.txt"

2003-06-01 Thread Sara
How to call the variables from the config file using CGI. pm? #!/usr/bin/perl use CGI; my $q = new CGI; require "config.txt"; print "Variables_from_the_config_file"; ??? Thanks, Sara.

Regex question.

2003-06-30 Thread Sara
dates like birth = 02151956 should be 02/15/1956 Any help?? Thanks, Sara.

Counting the characters..

2003-07-06 Thread Sara
There is a form field 'description' which is the input for CGI script. $description = "This is my description and it contains numerous __ double underscore marks and __ these marks some special area in the field" What I want to do is to count/extract the amount of times these double underscore

split function problem.

2003-07-08 Thread Sara
An input string like; $name_with_id = "Deiley, Sara Jr., 1234"; another example could be $name_with_id = "DEILEY SARA, Jr,. 123"; Two things are for sure in it always. 1- First part contains the alphabets (caps or small) with any number of commas and periods (full stops)

Re: split function problem.

2003-07-09 Thread Sara
First of all thanks for your prompt reply. its not just the comma separated list, it contains sometimes comma in the middle of name and sometime at the end of name. I am looking for some Regex in the split function to separate both fields. thanks, Sara. - Original Message - From

Reading and comparing files from a directory

2003-07-09 Thread Sara
I m trying to read the files in a directory and match them with a same file names in text list. Below given are the couple of lines, but I am unable to get the results, rather getting the same line repeated This fileno1 does NOT found in directory but its in the list This fileno2 does NOT found

Re: split function problem.

2003-07-09 Thread Sara
I am extremely thankful to you for your help. I always loved your way of teaching and explaining the code bit by bit. One more question I searched the google for "HTH" abbreviation but didn't find anything. Can you tell me what does it mean? Thanks, Sara, :)) - O

Net::FTP

2003-07-10 Thread Sara
if ( -f "$Directory/$_" ) { print "File '$_' exists in '$Directory'.\n"; # Optional: Add file to 'exists' list for later reporting. } else { print "File '$_' does NOT exist in '$Directory'.\n"; # Optional: Add file to 'not exists' list for later reporting. } } close( NO ); } else { print "ERROR: Unable to open file: $!\n"; } Thanks, SARA.

Comparing two text files.

2003-07-12 Thread Sara
found in data.txt though, file1.html and file2.html exists in data.txt Any ideas what I m doing wrong? I want to compare both text files and the script should produce that this. i.e after comparing the file nos. it should report which file is found and which is not found. file1.html was found in the data.txt file2.html was NOT found in the data.txt file3.html was foundi in the data.txt TIA, Sara.

Regex problem

2003-07-20 Thread Sara
$name = "SARA DEILEY"; how its possible to grasp only initials for First and Last name i.e $name ="SD"?? thanks.

Bolding and Underlining.

2003-07-21 Thread Sara
contains the colon at the end : Thanks for any input Sara.

Another Regex question.

2003-07-23 Thread Sara
$TS = "THIS INPUT IS IN ALL CAPS"; $TS_cont = lc $TS; $TS now prints out "this input is in all caps" What If I want first letter in caps for every word in string? which should be "This Input Is In All Caps" TIA, Sara.

Re: .htaccess

2003-07-26 Thread Sara
://javascript.internet.com and put "Must Come From" in the search box there, and hopefully it will come up with the script. Thanks, Sara. - Original Message - From: awarsd <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 24, 2003 4:27 PM Subject: .htacc

Flock Test...

2003-07-31 Thread Sara
What could be the simplest test to check 'flock' working on your server or not? except for writing to support team of host ::)) Thanks for any input. Sara.

Flock and Sleep

2003-08-14 Thread Sara
(sub get_number { open(NUMBER,">>data.txt"); flock (NUMBER, 2); Do blah blah blah close (NUMBER); closing a file automatically removes the lock?? or should I have to unlock it by placing flock (NUMBER, 8); close (NUMBER); My second question is how I can delay the execution of a script (If two

Regex and Email address.

2003-08-14 Thread Sara
@. I know I am poor at Regex (too poor). Thanks for any input. Sara. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Regex and Email address.

2003-08-14 Thread Sara
Simple Regex problem How you will convert $email = "[EMAIL PROTECTED]"; TO $email = "[EMAIL PROTECTED]"; using Regex. Thanks, Sara. - Original Message - From: gregg To: Sara Cc: [EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 6:59 AM Su

Formatting integer input

2003-08-21 Thread Sara
$one = 2.5; $two = 2; $three = $one + $two; print "$three"; # prints 4.5 I want 4.5 in proper format as 04.05 Any ideas? Thanks, Sara.

Defining Return-path ...

2003-09-02 Thread Sara
rint MAIL "To: $recip\n"; print MAIL "Reply-to: $email\n"; print MAIL "From: $email\n"; Thanks in advance, Sara.

Defining Return-path.....

2003-09-02 Thread Sara
rint MAIL "To: $recip\n"; print MAIL "Reply-to: $email\n"; print MAIL "From: $email\n"; Thanks in advance, Sara.

Stripping HTML from a text file.

2003-09-04 Thread Sara
file from a certain tag upto certain tag. For example; I want to delete the code completely that comes in between and (including any style tags and embedded javascripts etc) Any ideas? Thanks in advance. Sara.

Re: Stripping HTML from a text file.

2003-09-04 Thread Sara
Thanks a lot Hanson, It worked for me. Yep, you are right "The regex way is good for quick and dirty HTML work." and especially for the newbies like me :)) Sara. - Original Message - From: "Hanson, Rob" <[EMAIL PROTECTED]> To: "'Wiggins d&#

[Addendum] Stripping HTML from a text file.

2003-09-04 Thread Sara
'; $html = get($url); @html = split(/\n/,$html); foreach $line(@html) { chomp ($line); $line =~ s|.*?<\/head>||s; print "$line\n"; } # Thanks for any input. Sara. - Original Message - From: "Sara" <[EMAI

Perl/Linux problem.

2003-09-11 Thread Sara
t editor for Linux, if yes, what are the recommendations? Thanks for any input. Sara.

Re: Perl/Linux problem.

2003-09-11 Thread Sara
Apache Error Log: "premature end of script headers" Thanks, Sara. - Original Message - From: "Wiggins d'Anconia" <[EMAIL PROTECTED]> To: "Sara" <[EMAIL PROTECTED]>; "beginperl" <[EMAIL PROTECTED]> Sent: Fri

Re: Perl/Linux problem.

2003-09-11 Thread Sara
-- and simply print "Content-Type: text/html\n"; print "Hello World\n"; -- Thanks, Sara. - Original Message - From: "drieux" <[EMAIL PROTECTED]> To: "cgi cgi-list" <[EMAIL PROTECTED]> Sent: Friday, Septe

Truncate questions.

2003-09-13 Thread Sara
open (DB, "+

quotes problem

2003-10-20 Thread Sara
script stops printing everything after first quote ("), I KNOW where the problem is but at a loss to prevent it as I have tried all the options Any help!!!. thanks, Sara.

Re: quotes problem

2003-10-20 Thread Sara
I am getting the input from a form. Sorry but, If I Single quote the string, everything is then literal, it Won't work if there's a variable in the string. any other suggestion for the given below query string: http://foo.com/test.cgi?field=this%20is%20"My"%

Re: quotes problem (solved).

2003-10-20 Thread Sara
:) its solved, sorry I was making a mistake. Thank you all for prompt help. Sara. - Original Message - From: "Hanson, Rob" <[EMAIL PROTECTED]> To: "'Sara'" <[EMAIL PROTECTED]>; "beginners-cgi" <[EMAIL PROTECTED]> Sent: Tue

unlink help.

2003-10-29 Thread Sara
unlink <*.bak>; how I am supposed to specify directory above? for example I have to apply above unlink command to delete all backup files in the Specified directory. $dir = /home/path/to/dir is it right? unlink <$dir/*.bak>; ?? Any ideas? Thanks, Sara.

Re: unlink help.

2003-10-29 Thread Sara
Thanks, Thats the point, I wanted to confirm. Sara. - Original Message - From: "Wiggins d Anconia" <[EMAIL PROTECTED]> To: "Sara" <[EMAIL PROTECTED]>; "beginners-cgi" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thurs

Content-Length and printing

2003-11-03 Thread Sara
haracter line, after every 2 lines), how can I insert and then continue printing the remaining part? I tried to use 'while' statement but could not think of any good solution. Thanks in advance for any help. Sara. ### CODE ### $text = qq|

Delete/Archive older enteries.

2003-11-06 Thread Sara
g 7 days old enteries). So the database gets updated automatically and all the old enteries are deleted. Now what I am trying to do is to append deleted enteries to another file too. In case, If I need to access older enteries I can access that archived file. Any ideas? Thanks for you

Re: HTTP::Request

2003-11-06 Thread Sara
#!/usr/bin/perl use CGI; use LWP::UserAgent; my $q = new CGI; my $query = $q->param('query') || 'LWP'; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $response = $ua->get("http://search.cpan.org/search?query=$query";); if ($response->is_success) { my $server_response = $response->conte

extracting email addys.

2003-11-19 Thread Sara
-mails from the text above and performing s/@/#/; on all addresses at the same time? Just want to extract email addys and want to replace @ with something un-readable by spam bots. Thanks for any Regex help. Sara.

Bad referrer!

2003-12-06 Thread Sara
then why others are not getting any bad referrer error. If no, what could be the possible reasons that owner is the only person getting bad referrer error? TIA, Sara. @referers = ('http://www.foo.com', 'http://foo.co

Re: Bad referrer!

2003-12-07 Thread Sara
steer me in the right direction? Thanks for your help. Sara. - Original Message - From: "Wiggins d'Anconia" <[EMAIL PROTECTED]> To: "Sara" <[EMAIL PROTECTED]>; "beginperl" <[EMAIL PROTECTED]> Sent: Sunday, December 07, 2003 3:2

encrypting email address (to prevent spam)

2003-12-17 Thread Sara
r of those and vice versa. eg. $email = [EMAIL PROTECTED]"; using some search and replace/translate function ? $email = "blah..3b92a98ualwetwe334...blah"; and then translating it back to email when needed. Thanks for any input. Sara.

Comparing text text::diff

2004-03-06 Thread Sara
he typist to review the feedback from QA, it becomes a time waster. Now, I am looking for a way where I can highlight (by enclosing changes with tags) the changes (if the $text2 is different from $text1) either within the output of T

MIME::Lite

2004-03-08 Thread Sara
Is MIME::Lite only capable of sending email attachments present on your server? What If I want the users to give ability to attach files from their hard drives from a form input. Is there any other module for it? Thanks, Sara.

Regex Help!

2004-03-21 Thread Sara
ds (obvioulsy with 2 spaces in between) in the string however string may contain periods (.) and (,) in it. I am looking to extract. 1. First Character of the string. 2. Next two Characters after space in the String. Doe, John L.L.M should be "DJL" Simth, G. M.D. should be "SGM" Any help, please? Thanks, Sara.

CGI and mySQL book, any recommendation.

2004-05-28 Thread Sara
Looking to buy a comprehsive book on CGI and SQL, any recommendations. Thanks, Sara.

CPU load/server resources.

2004-07-13 Thread Sara
utine within the script that can give me the CPU/resource usage when the script runs? I have NO idea about it. Can anyone help me with it? Thanks in advance. Sara.

Re: CPU load/server resources.

2004-07-14 Thread Sara
CPAN module for it? I tried to search but failed to find. Once again thanks for your help. Sara. - Original Message - From: "Wiggins d Anconia" <[EMAIL PROTECTED]> To: "Alexander Blüm" <[EMAIL PROTECTED]>; "Sara" <[EMAIL PROTECTED]>; <[

Apache::Session Error Handling.

2004-09-22 Thread Sara
Wondering how I can show custom error message if session file doesn' exist. http://search.cpan.org/~cwest/Apache-Session/Session/File.pm If session file doesn't exist: using CGI::Carp qw(fatalsToBrowser); Software error: Object does not exist in the data store at /usr/share/perl5/Apache/Sessio

PPM problem.

2004-10-17 Thread Sara
I am trying to install DBI module for my perl installation on XP machine. Everything was working fine, I installed a lot of modules before using the same PPM, but now it has started giving this error (as shown below). I have searched, but failed to find anything. I installed a fresh version of Per

Re: untainting data

2004-11-10 Thread Sara
If the 'name' is coming from a Form, try limiting it within the form tags, it's always a better idea. OR if you insist to do it within script; use 'substr' function. my $name = param('name'); my $limited_name = substr($name, 0, 40); Thanks, Sara. -

Re: untainting data

2004-11-10 Thread Sara
>>> bad guys can always create their own form I can't say how others do it but almost my every script starts with: if ($ENV{'HTTP_REFREER'} !~ /yourdomain.com/) { exit; } it helps eliminating of Bad Guys forms & shoving of data (no remote postings allowed). Sara

Re: untainting data

2004-11-10 Thread Sara
No I don't know, can you please explain. How it can be spoofed, I am interested in details. - Original Message - From: "Bob Showalter" <[EMAIL PROTECTED]> To: "'Sara'" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, N

Reducing load on server.

2004-11-19 Thread Sara
can I do to reduce load on mySQL, PERL and server? Should I use CGI::Fast? 4- Anyother possible query? Thanks, Sara. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Extracting links.

2005-01-16 Thread Sara
uot;;> |; #extract LINKS (no image links) only http://www.mydomain.com";> my @get = grep {//} @array; print "@get\n" ### CODE END ### Thanks, Sara.

Content_Length

2005-02-03 Thread Sara
I have like 20 variable coming from a form, using CGI.pm in my script. I am at a loss as how to get $ENV{'Content_lenght'} for all of those collectively. Is there anything in CGI.pm for it?. I am trying to count every keystroke that user inputs to form. Thanks, Sara.

Addendum: Content_Length.

2005-02-03 Thread Sara
## Thanks, Sara.

removing dupes from fetchrow_array()?

2005-03-23 Thread Sara
Following is the code used in my CGI script. my $query = $dbh -> prepare("SELECT * FROM invoices WHERE ID = '$ID'"); $query -> execute(); while (my @row = $query -> fetchrow_array()){ print "$row[1] - $row[2] - $row[3]"; } What If I want to remove dupes from @row? like if $row[2] is similar

CGI::Cookie Reading.

2005-03-29 Thread Sara
ie doesn't exist or I mean for the first time visitor, it gives error: "Can't call method "value" on an undefined value" I tried to do something like it: if ($id) {do blah} else {do blah} but that's not working either. It's my first time using CGI::Cookie, how can I overcome this problem Thanks for any input, Sara.

Re: export to text file

2005-06-08 Thread Sara
I always used 'phpmyAdmin' for such tasks. Give it a try. Thanks, Sara. - Original Message - From: "Glauco Magnelli" <[EMAIL PROTECTED]> To: Sent: Wednesday, June 08, 2005 10:55 AM Subject: export to text file > I do a query to mysql table and view the re

Script execution time.

2005-08-03 Thread Sara
g in PERL/CGI? I searched CPAN but failed to find my desired requirements. Are there any system commands that can be executed within the script to get these values. TIA. Sara.

Regex Problem.

2005-08-18 Thread Sara
atching words within mySQL database. For example if the word is "blood" I want to get results using regex: for "blood": &check(blo) then &check(loo) &check(ood) for "Globin Test": &check(Glo) then &check(lob) &check(obi) &

Re: Regex Problem.

2005-08-18 Thread Sara
That's worked like a charm, You ALL are great. Thanks everyone for help. Sara. - Original Message - From: <[EMAIL PROTECTED]> To: "'Sara'" <[EMAIL PROTECTED]> Sent: Thursday, August 18, 2005 10:50 PM Subject: RE: Regex Problem. Hi Sara,

Exact matching using GREP.

2005-09-08 Thread Sara
s, php/forums and every element containing php. How I am supposed to do Exact matching that if $row->{CAT_TITLE} is 'perl/chat' it should pick only 'perl/chat' from @present. I saw the Unix man pages and did other searches and found '-x' switch to use for exact matching with GREP and '-e' switch for pattern matching but dont' know how to incorporate it within my code. TIA, Sara

Re: Exact matching using GREP.

2005-09-08 Thread Sara
No, it's not working, probably you didnt' get my question. Anyways, thanks for a prompt reply. Sara. - Original Message - From: "Ovid" <[EMAIL PROTECTED]> To: Sent: Friday, September 09, 2005 12:01 AM Subject: Re: Exact matching using GREP. --- Sara

Re: cookies as hidden files

2005-09-16 Thread Sara
window for fresh headers. I have never experienced HIDDEN cookies, new phenomenon for me atleast. HTH, Sara. - Original Message - From: "Denzil Kruse" <[EMAIL PROTECTED]> To: Sent: Friday, September 16, 2005 9:08 AM Subject: cookies as hidden files Hi all, I r

Re: Forcing a "save as' dialogue box to come up on left click

2005-09-20 Thread Sara
Hi all, Did you read it? Content-Disposition -> "do not enclose filenames in quotes" http://support.microsoft.com/kb/q182315/ Thanks, Sara. - Original Message - From: "Wiggins d'Anconia" <[EMAIL PROTECTED]> To: "Tony Frasketi" <[EMA

Re: Forcing a "save as' dialogue box to come up on left click

2005-09-20 Thread Sara
Hi all, Did you read it? Content-Disposition -> "do not enclose filenames in quotes" http://support.microsoft.com/kb/q182315/ Thanks, Sara.

Fast CGI.

2005-10-09 Thread Sara
I am a new dedicated server where: FastCGI: Enabled I am at a loss as what I need in my scripts to run them with Fast CGI? .fcgi extension? and what else. Thanks for any help. Sara.

Taking Multiple Values for The Same Form Field.

2005-10-28 Thread Sara
multiple name values will be coming.?? Thanks for any help. Sara.

Re: Taking Multiple Values for The Same Form Field.

2005-10-28 Thread Sara
Thanks for the quick respons, just need a bit more help. Now I need to write these values in a text file (I am fully aware of writing to files) but where I am gettin' confused is that : I told you that Name is a required field, but Email is optional. so what if : my @name = ('Sa

Re: uninitialized variable

2005-11-01 Thread Sara
my $action = param('form_action') || 'any_default_value'; HTH, Sara. - Original Message - From: "Chris Devers" <[EMAIL PROTECTED]> To: "Adedayo Adeyeye" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, November 01, 2005 8:42 PM Subje

Tracking/Blocking IPs.

2005-11-01 Thread Sara
ans that there is some way to detect it or it's because of https? If SSL can deal with this issue I am ready to go for it but just need to confirm or alternative solution to it before I make my move. Thanks for any help. Sara.

Re: Filering a file

2005-12-06 Thread Sara
"; exit; # End of Code #### Thanks, Sara. - Original Message - From: "Adedayo Adeyeye" <[EMAIL PROTECTED]> To: "'David Dorward'" <[EMAIL PROTECTED]>; "'Perl Beginners - CGI List'" Sent: Tu

Matching a string containing '+'

2006-02-07 Thread Sara
Using this query in my Perl Script to find the Category title from the database given as: C_and_C++/Forums C_and_C++/Codes C_and_C++/Sites etc. my $sql = qq(SELECT CAT_TITLE, FROM categories WHERE CAT_TITLE REGEXP '^C_and_C\\+\\+/[a-zA-Z|_]+\$' ) $query = $dbh -> prepare ($sql) or die "Couldn'

Electronic Signatures.

2006-03-05 Thread Sara
What is meant by "Electronic Signatrues"? How these could be implemented using Perl where the documents are being generated from forms input, but these documents need to be electronically signed. I tried to search, but my concepts are not clear about it. Anyone can help? Sara.

Re: referer throwing Internal Server Error

2006-03-13 Thread Sara
m|i) { print "Your not authorized: Bad Referer: $referer \n"; } else { print "all cool: $referer \n"; } Sara. - Original Message - From: "David Gilden" <[EMAIL PROTECTED]> To: Sent: Tuesday, March 14, 2006 6:30 AM Subject: referer throwing Internal

C++ query with mySQL

2006-04-09 Thread Sara
I have been stuck here, SOS call: Using CGI.pm, I have the script calling certain categories from mySQL table. my $cat = $q->param('cat'); my $dbh -> prepare ("SELECT * FROM main WHERE CAT='$cat'"); Sample Categories('CAT') are given below: PHP/Ad_Management/Classifieds Perl_and_CGI/Ad_Manageme

Regex Help.

2006-06-24 Thread Sara
Need help to remove EVERY thing (non-alphabets, symbols, ASCII codes etc) from a string except for a-zAZ, 0-9, dash and underscore. $string =~ s/?? Thanks, Sara.

Limiting Images Dimensions?

2006-09-02 Thread Sara
, limiting upload size, formats, etc but this problem is encountered first time. Any help? Sara.

Getting status of files before copying/moving.

2006-10-02 Thread Sara
uploaded at the time it was invoked. # Start of Subroutine # sub copy_files { use File::Copy; while (glob ("*.mp3")) { copy("home/uploads/$_", "home/backup/$_"); move("home/uploads/$_", "home/music/$_"); } } ## Thanks, Sara.

.wav and mp3 length.

2006-10-14 Thread Sara
Need to determine the .wav and mp3 file length not in bits or bytes, but in minutes. It's for a dictation recording service who needs to invoice the clients as per the minutes of files uploaded to their servers. I searched the CPAN but of no help. Thanks, Sara.

Convert Date to Timestamp.

2006-10-31 Thread Sara
I am getting Month, Day and Year from Drop Downs of a form to convert given values to Unix timestamp. I am able to put values in all the variables below except for $wday & $yday. Any ideas as how I can get those with limited user input of month, day and year only? #!/usr/local/bin/perl use POSI

Can't use string as a subroutine ref while "strict refs"

2006-11-09 Thread Sara
#x27;t use string ("main") as a subroutine ref while "strict refs. But somehow I don't want to remove the 'use Strict;' Any way out? Sara.

File Downlaod issue.

2007-04-19 Thread Sara
I have directory from which users are downloading files directly using FTP client (no browser). If I can run a script or program, which could tell me as which files have been downloaded? File::Stat changes? if they simply download the file from FTP? Or is there any other way? Sara.