Re: DBI
open a command prompt and type ppm install DBD-ODBC and ppm install DBI At 09:43 AM 6/18/2001 -0500, Kris Cook wrote: I'd like to try using the DBI interface for database access, but when I downloaded it from ActiveState, I fount that I had to have a make utility to get it installed. Does anyone know of a free make distribution for Win32 environments? It HAS to come in a compiled version, because right now I don't have a C or C++ compiler, and for various reasons I can't install one at this time. ___ Kristopher Cook (mailto:\\[EMAIL PROTECTED]) e-Commerce Director Galyan's Trading Company (317) 532-0200 x239 (317) 532-0258 (fax)
Re: Example of OOP cgi ?
On Mon, 18 Jun 2001, Vinicius Jose Latorre wrote: An interesting twist on the display is to use templates, e.g. the Template Toolkit or HTML::Template. Then not only is the display separated from the logic, but the views can then be maintained by a non-programmer. Another excellent URL is: http://www.perl.com/pub/2001/06/05/cgi.html Using CGI::Application Actually, CGI::Application is very similar to the solution I described a couple days earlier, although a bit more applicable to a wider variety of applications (mine not at all very generic and would require modification to move it to another application). I originally got the idea from recipe 19.12 in the Cookbook and expanded the concept. -- Brett http://www.chapelperilous.net/btfwk/ I could dance with you till the cows come home. On second thought, I'd rather dance with the cows till you come home. -- Groucho Marx
RE: DBI
I've tried to follow your suggestion, and I get the following error message: C:\perl\libppm install DBD Installing package 'DBD'... Error installing package 'DBD': Could not locate a PPD file for package DBD -Original Message- From: Tim Keefer [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 9:44 AM To: Kris Cook; [EMAIL PROTECTED] Subject: Re: DBI open a command prompt and type ppm install DBD-ODBC and ppm install DBI At 09:43 AM 6/18/2001 -0500, Kris Cook wrote: I'd like to try using the DBI interface for database access, but when I downloaded it from ActiveState, I fount that I had to have a make utility to get it installed. Does anyone know of a free make distribution for Win32 environments? It HAS to come in a compiled version, because right now I don't have a C or C++ compiler, and for various reasons I can't install one at this time. ___ Kristopher Cook (mailto:\\[EMAIL PROTECTED]) e-Commerce Director Galyan's Trading Company (317) 532-0200 x239 (317) 532-0258 (fax)
RE: DBI
On Mon, 18 Jun 2001, Kris Cook wrote: Actually, I've used make for all sorts of stuff without a C compiler. It's amazing what you can automate. Actually, I've even used it as the backbone for a QnD (Quick'n'Dirty) system security monitoring package before. I've also used it for automated publication of web pages based on changes to database or document files. That technique saved us a lot of overhead compared to dynamic, real-time CGI page generation. I know make can be used for a wide variety of things... I use it for building LaTeX documents. But in the case of building Perl modules, you will need a C compiler also. The Borland C++ compiler I think comes with a decent make utility -- you can get a free command-line compiler from Borland. I suspected it needed a compiler, though (despite the fact that I don't see any .c or .o files in the directories). I tried to go to PPM, but it keeps telling me the page is unavailable. I'm still interested in a make utility, though. I used to have a source code version of one (mostly in PC assembler), but it vanished during one of my moves. I hate when the vagaries of meatspace intrude upon my consciousness ;) I will also recommend getting CygWin environment -- it puts a fairly complete Unix-like development on your Windows system, inlcuding make and a C compiler. And it comes with Perl! -- Brett http://www.chapelperilous.net/btfwk/ If you can, help others. If you can't, at least don't hurt others. -- the Dalai Lama
database
I'm curious. Why, when the ODBC functionality is distributed with ActiveState's Perl, do all examples I see in this group use DBI? The application I'm working on uses an Access database, and I can't find Access drivers for DBD, so DBI is useless to me, along with every example using it. I'd LOVE to use DBI - placeholders in SQL alone are enough reason to switch - but it doesn't appear to be an option. It's very frustrating. And no, the database isn't, at least right now, an option - it's a customer thing, y'know. ___ Kristopher Cook (mailto:\\[EMAIL PROTECTED]) e-Commerce Director Galyan's Trading Company (317) 532-0200 x239 (317) 532-0258 (fax)
RE: MS Access DB
ok thats what i though !! would it be possible to convert the ms access db to somthing else ? thing is i have a friend .. who is using access db. he wants the info stored in it to be acess on-line to form part of customer services eg product details and rpair ststus .. etc ... as i said all the data is in an access db .. if i could convert it to something else would be fine. -Original Message- From: Michael D. Risser [mailto:[EMAIL PROTECTED]] Sent: 18 June 2001 17:38 To: [EMAIL PROTECTED] Subject: Re: MS Access DB On Monday 18 June 2001 09:22 am, you wrote: i was wondering is it possible to use a MS Access Db on a linux server eg my host webfusion !? and if yes what modules would i need ?? cheers in advance !! [---] Kris G Findlay [EMAIL PROTECTED] [---] You can't run the MS Access DB on Linux, you have to have it on a Windows box, or possibly a Mac. You can, as far as I know, access it from a Linux Web Server though. You need the DBI module and DBD::ODBC module to communicate to the DB.
Re: MIME::Lite
Teresa Raymond write: : OK, I'm not going to write my own script for attaching an email. I'm : going to try to modify the script from Randal's Web Techniques. I : need to point to the location of MIME::Lite. I'm having difficulty : with syntax with CGI.pm and strict. all of the below gives a server : 500 error. Find out where your server's error log file is kept and check it right after you get one of these errors. It will help you immensely. : #ORIGINALLY SAID : if (@params) : {require MIME::Lite; : : #DOES NOT WORK: : if (@params) : {require /www/host/cgi-bin/Lite.pm; : : #DOES NOT WORK: : if (@params) : {require ('/www/host/cgi-bin/Lite.pm'); * Are you sure that this is the line that the script is dying on? * What are the permissions on the Lite.pm module? It must be readable by whatever user your HTTP server is running as. * In general, it's not a good idea to simple copy the .pm file into an area (especially the CGI area). You're better off doing an actual install. Do perldoc perlmodinstall or see http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlmodinstall.html for instructions aboutr installing Perl modules. -- tdk
Re: testing for max size of file
Curtis Poe wrote: : That will only give the approximate filesize. $ENV{CONTENT_LENGTH} is the total :size of the : entity body. With 'multipart/form-data' (the enctype used with file uploading), the :entity bodies : size is even larger than normal. The more data sent (besides the file), the larger : $ENV{CONTENT_LENGTH} will be. : : Unless I am mistaken, CGI.pm does not track filesize data directly. If the POST :size (not file : size) is larger than what CGI.pm is allowed, then $query-cgi_error will contain the :text 413 : Request entity too large. That's right. Here's an extract from CGI.pm: $content_length = defined($ENV{'CONTENT_LENGTH'}) ? $ENV{'CONTENT_LENGTH'} : 0; ... METHOD: { # avoid unreasonably large postings if (($POST_MAX 0) ($content_length $POST_MAX)) { $self-cgi_error(413 Request entity too large); last METHOD; } So it's checking the CONTENT_LENGTH. There is, I believe, no other way to get the file size without actally measuring the uploaded file; but of course, the point of checking the size is to not let huge files get this far. So I think CONTENT_LENGTH, imperfect though it may be, is the only way to *prevent* a large file from getting on your system in the first place. -- tdk
Your Guidence Please
I am Interested In creating a Mirc Bot that Pulls Information From a Database Via Triggers, If someone has seen this Done, Or Knows of some Open examples, Could you please forward some examples to me. Thank you
RE: database
Well, interestingly, DBD-ODBC works fine here at the office, and on my Win2K platform at home. However, it doesn't like (or isn't liked by) my Windows ME machine at home, resulting in an illegal instruction in PWS (Pretty Weak Software) every time. Of course, I hate Windows ME anyway, so to h*** with it. -Original Message- From: Mark Bergeron [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 1:56 PM To: Kris Cook; [EMAIL PROTECTED] Subject: Re: database Have you not tried DBD-ODBC? -Original Message- From: Kris Cook[EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Mon Jun 18 08:30:16 PDT 2001 Subject: database I'm curious. Why, when the ODBC functionality is distributed with ActiveState's Perl, do all examples I see in this group use DBI? The application I'm working on uses an Access database, and I can't find Access drivers for DBD, so DBI is useless to me, along with every example using it. I'd LOVE to use DBI - placeholders in SQL alone are enough reason to switch - but it doesn't appear to be an option. It's very frustrating. And no, the database isn't, at least right now, an option - it's a customer thing, y'know. ___ Kristopher Cook (mailto:\\[EMAIL PROTECTED]) e-Commerce Director Galyan's Trading Company (317) 532-0200 x239 (317) 532-0258 (fax) /~_. _ | _ _ _ _ \_/|(_||| | |(_)| | _| ___ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com
RE: Your Guidence Please
hey Ginn !! fancy seeing you here !! check out this perl ircbot at http://www.infobot.org/ [---] Kris G Findlay [EMAIL PROTECTED] [---] ( Ghost-Hunter ) -Original Message- From: Ginntonnik [mailto:[EMAIL PROTECTED]] Sent: 18 June 2001 22:34 To: [EMAIL PROTECTED] Subject: Your Guidence Please I am Interested In creating a Mirc Bot that Pulls Information From a Database Via Triggers, If someone has seen this Done, Or Knows of some Open examples, Could you please forward some examples to me. Thank you
RE: DBI
you should not need a c compiler for make. On windows, however, it is either nmake or dmake (I've heard of dmake, but never used it. it has always been nmake for me) You should use PPM, but if you need a module that needs a make on windows you can just substitute nmake for the word make in the installation instructions. enjoy, Steve Howard -Original Message- From: Kris Cook [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 9:44 AM To: [EMAIL PROTECTED] Subject: DBI I'd like to try using the DBI interface for database access, but when I downloaded it from ActiveState, I fount that I had to have a make utility to get it installed. Does anyone know of a free make distribution for Win32 environments? It HAS to come in a compiled version, because right now I don't have a C or C++ compiler, and for various reasons I can't install one at this time. ___ Kristopher Cook (mailto:\\[EMAIL PROTECTED]) e-Commerce Director Galyan's Trading Company (317) 532-0200 x239 (317) 532-0258 (fax)
RE: How to generate a table ?
Glenn Curtis; Thanks for the suggestions ... but more thanks to both you and Curtis for helping me to start thinking out of my box... and this is why I'm replying ... I have used both of your suggestions - the hash below and cgi html shortcuts ... I just needed to stop and invest a little time in a new tool - cgi - so I ended up gutting the program ... reads a lot better with the shortcut once you get use to them... both suggestions reduced the code by 50% or so. I don't know if it's my version of cgi but the only thing I don't like about the shortcuts is it doesn't generate \n so when you are working on the html - the generated code - it's hard to read when you look at the source if you didn't do something correct. Once it's working I wouldn't care in most cases... (I could(did) physically put \n in as an element in the row for the Tr but would be nice not to have to ... same with other shortcuts (and again I did just add an element or entry where I wanted)... ) but it's REAL nice not to have to remember the closing tag and I do like the way the program reads once use get use to coding the shortcuts But I wanted to share with you an added benefit to the struct below ... I have an other table 9 columns by n rows and build from a database... three different tables yielding three columns each ... I generated the form and was looking and wanted to move one of the sets of columns to the left side of the table ... Well, guess what... with your struct just change the sequence and the table is regenerated with the columns moved ... no change to the code except change 1,2,3 to 7,8,9 and 7,8,9 to 1,2,3... Thanks again to both you Curtis ... I hope others get some use out of this also PS... Oh, thanks for reminding me about $_ ... I forget that Perl will help me if I'll let it ... it gets old thinking of names for the foreach when you really don't care what it returned ... again just needed to get out of my box ... bad habits are hard to break ! John W Moon -Original Message- From: Tillema, Glenn [mailto:[EMAIL PROTECTED]] Sent: June 15, 2001 18:56 To: 'Moon, John'; [EMAIL PROTECTED] Subject: RE: How to generate a table ? #!/usr/local/bin/perl -w use CGI qw/:standard *table/; $cust_id = cust; $acct = account; $title = title; %hofEntries = (1 = {label = Customer Id, name = NEWCUST_ID, def = $cust_id, size = 10,}, 2 = {label = Account, name = NEWACCT, def = $acct, size = 15,}, 3 = {label= Title, name = NEWTITLE, def = $title, size = 15,}); $q = new CGI; print header, start_html; print start_table; foreach (sort keys %hofEntries) { print Tr(td({-align=RIGHT}, $hofEntries{$_}{'label'},b(':')), td({-align=LEFT}, $q-textfield(-name=$hofEntries{$_}{'name'}, '-default'=$hofEntries{$_}{'def'}, -size=$hofEntries{$_}{'size'}, -maxlength=$hofEntries{$_}{'size'}))); } print end_table; print end_html; I noticed that you kept repeating the same things over and over so I shoved the table contents into a loop. For three entries it doesn't really save you a lot of space but as your number of entries increase it will. I'm sure someone else can come up with a better way of loading the hash to make it even simpler ... cheers, Glenn Glenn Tillema [EMAIL PROTECTED] ADC Telecommunications, Inc. PO Box 1101, MS 508 Minneapolis, MN 55440-1101 Learn about ADC - The Broadband Company - www.adc.com -Original Message- From: Moon, John [mailto:[EMAIL PROTECTED]] Sent: Friday, June 15, 2001 5:08 PM To: [EMAIL PROTECTED] Subject: How to generate a table ? Could someone please suggest a simpler way to generate this table ... print 'table', 'tr', 'td align=right', 'Customer Id B:/B ', '/td', 'td align=left', $q-textfield(-name='NEWCUST_ID', -default=$cust_id,-size=10, -maxlength=10), '/td', /tr\n, 'tr', 'td align=right', 'Account B:/B ', '/td', 'td align=left', $q-textfield(-name='NEWACCT', -default=$acct, -size=15, -maxlength=15), '/td', /tr\n, 'tr', 'td align=right', 'Title B:/B ', '/td', 'td align=left', $q-textfield(-name='NEWTITLE',-default=$title, -size=50,-maxlength=100), '/td', /tr\n, /table\n; John W Moon
beginner's addressbook tutorial - step 6 - writing utility and SQL classes, and using Class::MethodMaker
step 6 is complete, and is available at: http://www.peacecomputers.com/addressbook_toot-step6.html coming next - step 7 - A summary of what we've done so far note: there was an error in the html::template file provided in step 5, i've corrected it (i left out input elements for the prefix and city).
Lesson Four of online CGI course
For the curious: I have recently finished Lesson 4, part 1 (http://www.easystreet.com/~ovid/cgi_course/lesson_four/lesson_four_1.html) of my online CGI course (http://www.easystreet.com/~ovid/cgi_course/index.html). There have been a few corrections to the rest of the course and improved site navigation, amongst other things. Cheers, Curtis Poe = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/