Re: buton names
It worked on normal submit buttons but problem on image submit button. I couldn't manage to work it with image submit buttons. Fot example if their 2 image submit buttons as : input type=image border=0 name=button3 value=This is button 3 src=c:\windows\desktop\house.gif width=100 height=50brbrbr input type=image border=0 name=button4 value=This is button 4 src=c:\windows\desktop\debugreport.jpg width=100 height=50 cgi cannot get the names of these? Must i use other module? thanxs bye - Original Message - From: Brett W. McCoy [EMAIL PROTECTED] To: GsuLinuX [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 6:26 AM Subject: Re: buton names On Wed, 13 Feb 2002, GsuLinuX wrote: There are 2 submit butons under my form and the information entered to the form will be send to different cgi's. How can i do this? One idea i thougt is to give names to the buttons and in the cgi : if buton name is buton1 { code1 } if buton name is buton2 {code2 } You have two submit buttons, each with the same name but a different value. print submit(-name='action', -value='Add' ); print submit(-name='action', -value='Delete' ); They won't go to different CGI scripts, but a single CGI script will have those button names (you should give them values also) as parameters, so you can take different action based on the button names. I would use a hash of coderefs to handle this: my $action_button = param('action'); my %actions = ( 'Add' = \add 'Delete' = \delete ); $action($action_button)-(); sub add { .. } sub delete { }; Or, alternatively, you could use CGI::Application to accomplish this (which also uses a hash of coderefs to handle multiple actions). -- Brett http://www.chapelperilous.net/ Air is water with holes in it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help with ODBC/CGI/IIS
Hi - I am getting the following error when running a cgi script in IIS.This same code worked fine using Apache and I am not sure what is happening. The error is: Perhaps the capitalisation of DBD 'ODBC' isn't right. at C:\Inetpub\Scripts\clickcount.cgi line 210 Here is my connection code: $dbh = DBI-connect( q{DBI:ODBC:ExLinks}, {RaiseError = 1, PrintError = 1, AutoCommit = 1} ); The ODBC.pm file is located in the \perl\site\lib\dbd\ directory, and I did not think this was the problem. Although there is a w32odbc.pm file there as well. If I chnage the script to $dbh = DBI-connect( q{DBI:w32ODBC:ExLinks} I get a similar error to the error above. I saw a note from a while ago stating this might be a permissions error and to check the odbc entry for the db. Once I am in regedit.,however, I am not sure where to look to change this ??(I did set the odbc connection up using 'system dsn').. Any help would be greatly appreciated : Thanks in advance, Liz H. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Generating for loop paterns HELP!
Hi I have done (b) for coding see below, could someone assist with (a) (b) (d) #!/usr/local/bin/perl -w my $num_rows; my $i; my $r; $num_rows = STDIN; for ($r = 1; $r = $num_rows; $r++) { for ($i=1; $i= $r; $i++) {print ( \n);} for ($i = $num_rows + 1 - $r;$i=1; $i--){ print ( * );} }# end for print ( \n); solution: - 5 * * * * * * * * * * * * * * * Thanks Bruce ---BeginMessage--- I have written following coding to produce a triangle pattern(see below); I now want to produce following paterns I can't figer this out (a)(b) (c) (d) diamond ** * * * * * * * * * * * * * * * ** * * ** * * * * * * * ** * * * * * * * * * * * ** * * * * * * * * * * * * ** * * * * * * * __ #!/usr/local/bin/perl -w my $num_rows; my $i; my $r; $num_rows = STDIN; for ($r = 1; $r = $num_rows; $r++) { # indent by printing num_rows - r spaces for ($i = 1; $i = $num_rows - $r; $i++) {print ( \n);} # print r asterisks for ($i=1; $i= $r; $i++) { print ( *);} # drop cursor to a new line print \n; } # end for - unxsup:/home/bruce$ perl triangle.pl 5 * * * * * * * * * * * * * * * Cheer Bruce -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ---End Message--- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with ODBC/CGI/IIS
Once I am in regedit.,however, I am not sure where to look to change this in general you don't set permissions in Regedit. try right clicking on the fole in question looking at the Security tab. Al -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Generating for loop paterns HELP!
Hi Everyone had to crawl before they could walk, JON, stop being polite and help me I need your assistance now... Cheers Bruce Jon Molin [EMAIL PROTECTED] 02/14/02 12:00PM This smells homework! /jon Bruce Ambraal wrote: Hi I have done (b) for coding see below, could someone assist with (a) (b) (d) #!/usr/local/bin/perl -w my $num_rows; my $i; my $r; $num_rows = STDIN; for ($r = 1; $r = $num_rows; $r++) { for ($i=1; $i= $r; $i++) {print ( \n);} for ($i = $num_rows + 1 - $r;$i=1; $i--){ print ( * );} }# end for print ( \n); solution: - 5 * * * * * * * * * * * * * * * Thanks Bruce Subject: Help can't figure this one out Date: Thu, 14 Feb 2002 08:24:11 +0200 From: Bruce Ambraal [EMAIL PROTECTED] To: [EMAIL PROTECTED], [EMAIL PROTECTED] I have written following coding to produce a triangle pattern(see below); I now want to produce following paterns I can't figer this out (a)(b) (c) (d) diamond ** * * * * * * * * * * * * * * * ** * * ** * * * * * * * ** * * * * * * * * * * * ** * * * * * * * * * * * * ** * * * * * * * __ #!/usr/local/bin/perl -w my $num_rows; my $i; my $r; $num_rows = STDIN; for ($r = 1; $r = $num_rows; $r++) { # indent by printing num_rows - r spaces for ($i = 1; $i = $num_rows - $r; $i++) {print ( \n);} # print r asterisks for ($i=1; $i= $r; $i++) { print ( *);} # drop cursor to a new line print \n; } # end for - unxsup:/home/bruce$ perl triangle.pl 5 * * * * * * * * * * * * * * * Cheer Bruce -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Generating for loop paterns HELP!
This smells homework! /jon Bruce Ambraal wrote: Hi I have done (b) for coding see below, could someone assist with (a) (b) (d) #!/usr/local/bin/perl -w my $num_rows; my $i; my $r; $num_rows = STDIN; for ($r = 1; $r = $num_rows; $r++) { for ($i=1; $i= $r; $i++) {print ( \n);} for ($i = $num_rows + 1 - $r;$i=1; $i--){ print ( * );} }# end for print ( \n); solution: - 5 * * * * * * * * * * * * * * * Thanks Bruce Subject: Help can't figure this one out Date: Thu, 14 Feb 2002 08:24:11 +0200 From: Bruce Ambraal [EMAIL PROTECTED] To: [EMAIL PROTECTED], [EMAIL PROTECTED] I have written following coding to produce a triangle pattern(see below); I now want to produce following paterns I can't figer this out (a)(b) (c) (d) diamond ** * * * * * * * * * * * * * * * ** * * ** * * * * * * * ** * * * * * * * * * * * ** * * * * * * * * * * * * ** * * * * * * * __ #!/usr/local/bin/perl -w my $num_rows; my $i; my $r; $num_rows = STDIN; for ($r = 1; $r = $num_rows; $r++) { # indent by printing num_rows - r spaces for ($i = 1; $i = $num_rows - $r; $i++) {print ( \n);} # print r asterisks for ($i=1; $i= $r; $i++) { print ( *);} # drop cursor to a new line print \n; } # end for - unxsup:/home/bruce$ perl triangle.pl 5 * * * * * * * * * * * * * * * Cheer Bruce -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: buton names
On Thu, 14 Feb 2002, GsuLinuX wrote: It worked on normal submit buttons but problem on image submit button. I couldn't manage to work it with image submit buttons. Fot example if their 2 image submit buttons as : input type=image border=0 name=button3 value=This is button 3 src=c:\windows\desktop\house.gif width=100 height=50brbrbr input type=image border=0 name=button4 value=This is button 4 src=c:\windows\desktop\debugreport.jpg width=100 height=50 cgi cannot get the names of these? Must i use other module? The problem with image buttons is that they return name.x and name.y (with the corrdinates of where they were clicked) to your CGI script, so you will need to find out which image was clicked that way. You could do something like (using CGI.pm): use CGI; my $q = new CGI; my %params = $q-Vars(); #put all params into hash my $button; foreach(keys %params) { if(/(.*)\.x) { $button = $1; } } -- Brett http://www.chapelperilous.net/ QOTD: If you're looking for trouble, I can offer you a wide selection. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Help with ODBC/CGI/IIS
Yes, by all means get out of the registry. There are so many other ways to set your stuff up. Unless of course you really like that sort of thing. Here is a link from MS on IIS. It may help: http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/prodtechnol/iis/tips/iis5chk.asp IIS 5 Overview and tips: http://www.microsoft.com/windows2000/en/server/iis/ I have also used some of MS's lookdown tools and other utilities. I have those links too if you want them. Mark -Original Message- From: Al Hospers[EMAIL PROTECTED] To: 'Hall.Liz'[EMAIL PROTECTED], [EMAIL PROTECTED] Date: Thu Feb 14 02:28:59 PST 2002 Subject: Re: Help with ODBC/CGI/IIS Once I am in regedit.,however, I am not sure where to look to change this in general you don't set permissions in Regedit. try right clicking on the fole in question looking at the Security tab. Al -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
where to rename a file in this sub?
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 ($realname),\n; close(EL); rename($emailLog,$emailLog.old); # remove duplicates open(EL,$emailLog) || die Problem, Could not open $emailLog, $!; my @lines = EL; close(EL); open(EL,$emailLog.old) || die Write file, could not find $emailLog.old, $!; my %seen; @lines = sort @lines; foreach(@lines){ # next if /test/; $_ =~ s/^\s+(.*)\s+$/\1,/; print EL unless $seen{$_}++; } close(EL); rename($emailLog.tmp, $emailLog); } ** * Cora Connection Your West African Music Source * * http://www.coraconnection.com/ * * Resources, Recordings, Instruments More! * ** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
WML header
Does anyone know what header to send for WML pages (WAP), and how to send it with CGI ? Thanks, Carl Please don't cc me. I'm on the list. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
removing white space
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/; } - #!/usr/bin/perl use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use POSIX 'strftime'; $mailprog = '/usr/lib/sendmail'; # Retrieve Date $date = strftime('%A, %B %1d, %Y %I:%M %p',localtime) ,\n; # my %in = {}; # remove any extra spaces at the front or back foreach $item (param()) { my $value = param($item); $value =~ s/^\s+//; $value =~ s/\s+$//; } $email = param('email'); $realname = param('name'); ** * Cora Connection Your West African Music Source * * http://www.coraconnection.com/ * * Resources, Recordings, Instruments More! * ** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: removing white space
The first is more efficient, the second is less typing. And actually the second one is incorrect, it should be this: Rob -Original Message- From: David Gilden [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 12:29 PM To: [EMAIL PROTECTED] Subject: removing white space 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/; } - #!/usr/bin/perl use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use POSIX 'strftime'; $mailprog = '/usr/lib/sendmail'; # Retrieve Date $date = strftime('%A, %B %1d, %Y %I:%M %p',localtime) ,\n; # my %in = {}; # remove any extra spaces at the front or back foreach $item (param()) { my $value = param($item); $value =~ s/^\s+//; $value =~ s/\s+$//; } $email = param('email'); $realname = param('name'); ** * Cora Connection Your West African Music Source * * http://www.coraconnection.com/ * * Resources, Recordings, Instruments More! * ** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: removing white space
Oops, I sent that before I was done (sliped with the fingers). The first is more efficient, the second is less typing. And actually the second one is incorrect, it should be this: $value =~ s/^\s*(.*)\s*$/$1/; You need to use \s* because one of them might match a space and the other might not. The way you had it would only with if there was both a leading and trailing whitespace char(s). But yes, either will work... although most will recommend the first option due to performance (although it is minimal unless the string is very large). Rob -Original Message- From: Hanson, Robert Sent: Thursday, February 14, 2002 12:36 PM To: 'David Gilden'; [EMAIL PROTECTED] Subject: RE: removing white space The first is more efficient, the second is less typing. And actually the second one is incorrect, it should be this: Rob -Original Message- From: David Gilden [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 12:29 PM To: [EMAIL PROTECTED] Subject: removing white space 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/; } - #!/usr/bin/perl use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use POSIX 'strftime'; $mailprog = '/usr/lib/sendmail'; # Retrieve Date $date = strftime('%A, %B %1d, %Y %I:%M %p',localtime) ,\n; # my %in = {}; # remove any extra spaces at the front or back foreach $item (param()) { my $value = param($item); $value =~ s/^\s+//; $value =~ s/\s+$//; } $email = param('email'); $realname = param('name'); ** * Cora Connection Your West African Music Source * * http://www.coraconnection.com/ * * Resources, Recordings, Instruments More! * ** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WML header
Carl Franks wrote: Does anyone know what header to send for WML pages (WAP), and how to send it with CGI ? there was an article on this very subject in tpj about a year ago. http://www.samag.com/documents/s=1131/sam05040004/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help with ODBC/CGI/IIS
just out of curiosity... where do you get IIS these days? at one time it was a d/l on the MS site it also came with my NT server. can you d/l IIS5 somewhere? Al Hospers CamberSoft, Inc. alatcambersoftdotcom http://www.cambersoft.com Shockwave and Director development, CD-ROM, HTML, CGI scripting, and Graphic Design. A famous linguist once said: There is no language wherein a double positive can form a negative. YEAH, RIGHT -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Percent printing in CGI...
Hello, I am having a problem printing percents within my PERL program when I add in CGI. Here the PERL program works great when printing. printf Percent Addresses Used . . . . %2.0f%%\n, $percentused; PERL output Percent Addresses Used . . . 59% Here I have added the CGI to the PERL. printf p(Percent Addresses Used . . . . %2.0f%%, $percentused); CGI output Percent Addresses Used . . . 0% 58.7301587301587 Please help. How do I get the CGI output to print like the PERL output in this case? Jerry Everett
Re: Percent printing in CGI...
On Thu, 14 Feb 2002 at 19:46 GMT, Jerry Everett Jr wrote: I am having a problem printing percents within my PERL program when I add in CGI. You have a problem with your parens in the printf function. #!/usr/bin/perl -w use strict; use CGI qw(:html); for my $percent ( 0.5, 5.434, 12.12, 100 ){ printf(p('2.Percent addresses used: %2.0f%%'), $percent) } __END__ -- briac dynamic .sig on strike, we apologize for the inconvenience -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help me out
NO! Don't use Matt's Script Archive!!! That code is old and full of errors. Go to http://nms-cgi.sourceforge.net/ and you will find the rest of the story and equivalent scripts that are well written and tested. Also, check out http://perl.about.com/ for some good beginners stuff. Good Luck! Dennis -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help ...
I purchased a Mail This Page To A Friend script that I'm doing some tweaking on, but I can't figure out a particular item in the function that parses HTML code to be formatted into a standard e-mail message. Here's the convention the parser is using ... $mail_body =~ s/\quot;//g; In other words, replace quot; with in the e-mail. Now, here's what I want to do. Extract image HTML code in this format ... img src=images/imagename.jpg width=x height=y alt=[ Image Description ] so that only the Image Description is left. Basically, I want to delete all the rest of the code but leave the alt tag information intact. I've tried this, but it doesn't work ... $mail_body =~ s/img src\=\([^])*\//g; $mail_body =~ s/width\=\\d\//g; $mail_body =~ s/height\=\\d\//g; $mail_body =~ s/alt\=\\[//g; $mail_body =~ s/\]\//g; Any ideas? Thanks, Jason __ Jason LaMar tel 740-368-3307 Director of Web Services fax 740-368-3328 Ohio Wesleyan University e-mail [EMAIL PROTECTED] Delaware, OH 43015 online http://web.owu.edu/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
my first C++ CGI won't work
Hi, I am stuck trying to get a simple C++ CGI working. I am using the installed configuration file which allows Apache to succesfully serve up a web page under document root: DocumentRoot C:/Apache/Apache Group/Apache/real_docs/deepconnection under script alias I have: ScriptAlias /cgi-bin/ C:/Apache/Apache Group/Apache/cgi-bin/ I have this line in the web page !-- #exec cgi=/http://www.deepconnection.com/cgi-bin/hello.exe; -- which I want to call an exe file of C++ code which is in C:/Apache/Apache Group/Apache/cgi-bin/ the c++ code is #include iostream.h //FOR cin AND cout void main () { cout Content-type: text/html\n\n; cout Hello world from Stephen; }//end main but it doesn't work. when I put http://localhost/cgi-bin/hello into browser I get Internal Server Error I thought I was doing everything right. Can anyone help? Cheers Stephen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help ...
Jason LaMar wrote: Now, here's what I want to do. Extract image HTML code in this format ... img src=images/imagename.jpg width=x height=y alt=[ Image Description ] so that only the Image Description is left. Basically, I want to delete all the rest of the code but leave the alt tag information intact. consider using html::parser. it may be an easier solution than struggling with your own regex. http://search.cpan.org/search?dist=HTML-Parser -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: my first C++ CGI won't work
On 2/15/02 12:00 PM, Stephen Warburton [EMAIL PROTECTED] wrote: Hi, Hey Stephen, I am stuck trying to get a simple C++ CGI working. I am using the installed configuration file which allows Apache to succesfully serve up a web page under document root: DocumentRoot C:/Apache/Apache Group/Apache/real_docs/deepconnection I don't mean to sound mean, but does this look like a C++ or Apache list? :) I have this line in the web page !-- #exec cgi=/http://www.deepconnection.com/cgi-bin/hello.exe; -- I haven't really looked the thing over, but I believe you need to use absolute or relative path in SSI directives... no full addresses. I.e., something along the lines of: !--#exec cgi=/cgi-bin/hello.exe-- You might also try !--#include virtual=/cgi-bin/hello.exe-- I'm also pretty sure that the SSI won't work if you have a space between the !-- and #. Capitalization and whitespace matter with almost everything. I think that'll help, but I very well might be completely wrong, and may have just humiliated myself. Oh well. Try asking on a more appropriate list :) -- Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help ...
On Fri, 15 Feb 2002 at 00:42 GMT, Jason Lamar wrote: I purchased a Mail This Page To A Friend script that I'm doing some tweaking on, but I can't figure out a particular item in the function that parses HTML code to be formatted into a standard e-mail message. snip ... so that only the Image Description is left. Basically, I want to delete all the rest of the code but leave the alt tag information intact. use a proper HTML parsing tool to do that for you. HTML::Parser is quite easy to use with little practice. #!/usr/bin/perl -w use strict; use HTML::Parser 3; my $html = '_HTML_'; pHello img src=/gifs/earth.gif with=30 height=30 alt=World /!/p _HTML_ HTML::Parser-new( report_tags = ['img'], start_h = [ sub { print shift-{alt} }, 'attr' ], text_h = [ sub { print shift }, 'dtext' ], )-parse($html); __END__ -- briac dynamic .sig on strike, we apologize for the inconvenience -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]