Sources

2001-07-09 Thread Guillaume Denizot
Hello, when I execute this script : "#!/usr/bin/perl -w use DBI; print "Content-type:Text/html\n\n"; print "Pilotes disponibles:\n"; @drivers=DBI->available_drivers; foreach(@drivers) { print "$_ \n"; } $driver="mysql"; @sources=DBI->data_sources($driver); print "\nSources de donnees disponibles:

SQL: Moving a row from one table to another.

2001-07-09 Thread Daniel Falkenberg
List, I would like to be able to move a row from one table to another table within the same database. Off the top of my head I suppose the SQL command would look similar to the following... my $sql = 'MOVE * FROM table1 WHERE unique_id = '' TO table2'. FINISH Then I would like to be able

Re: how to upload a file through an html form, again.

2001-07-09 Thread Dave Hoover
Hytham wrote: > hi gurus, > first of all, am really gracefull about all who > sends me tips of how to > make this thing work, but, unfortunately, it doesn't > yet. I'm not sure if this will help, but here is a snippet from a program I've been working on that uploads html files from a client

Re: Use CGI.pm or Parse it in the script?

2001-07-09 Thread Jason Purdy
Just wanted to say two things: 1) These are my sentiments exactly - I've only been on this list for a few days and I've seen a lot of religous responses. However, as a newbie, I don't mind extra flack as long as I can get to the meat of the matter (ie: sometimes when you guru's respond, you make

extension

2001-07-09 Thread RL Autry
Hello everyone: Can anyone tell us where to find a list of all of the extensions used in cgi programming. Such as in this address:cgi-bin/rightnow.cfg/php/ what would type of Perl file would*.cfg be? We are trying to learn what they are and the individual purposes behind them. If any

Re: how to upload a file through an html form, again.

2001-07-09 Thread Jason Purdy
Check out the CGI documentation - it's very thorough and has a lot of excellent examples. Looking at the synopsis example, it looks like you're missing an if ($q->param()) { ... } around the file uploading part of your code. Give that a shot... Jason > here it is: > #!/usr/bin/perl > use CGI;

how to upload a file through an html form, again.

2001-07-09 Thread Hytham Shehab
hi gurus, first of all, am really gracefull about all who sends me tips of how to make this thing work, but, unfortunately, it doesn't yet. here it is: #!/usr/bin/perl use CGI; $q = new CGI; print $q->header, $q->start_html('title here'), $q->h1('Please fill this form'), $q->start_multip

Re: Use CGI.pm or Parse it in the script?

2001-07-09 Thread GPG
Curtis, *sigh* Thanks for the information. I'll tell you, my site is all flash, and I wanted to make it a bit more interesting by having some dynamic data on the site facilitated by CGI. Trying to find a -simple- resource for learning Perl has been a real struggle. Perl seems more like a relig

The binary file as CGI output

2001-07-09 Thread Evgeny Goldin (aka Genie)
Hello, My goal is following : after user accesses http://host/script.pl ( either by direct link or by submitting the filled form ) I'd like to open a "Save as" dialog - to let him download a binary ( compressed ) file. 1) print header( "application/x-gzip" ); open ( FIN, "TXTs.tar.gz"

Re: file modification dates

2001-07-09 Thread Randal L. Schwartz
> "Thomas" == Thomas Jakub <[EMAIL PROTECTED]> writes: Thomas> I'm trying to see when a file was last modified. Thomas> Here's the code segment... Thomas> open filename, ">temp"; Thomas> #random time consumming statements go here Thomas> $then = time; Thomas> utime $then, $then, filename; Th

Re: Shifting bits

2001-07-09 Thread Randal L. Schwartz
> "Brian" == Brian Jackson <[EMAIL PROTECTED]> writes: Brian> Unfortunately I don't have any Perl books available to me at this time Brian> and I am trying to find the answer to this on the web, but have had no Brian> luck thus far...does anyone know if there is a shift operator in Perl Brian

Re: floor

2001-07-09 Thread darren chamberlain
Christopher Zukowski <[EMAIL PROTECTED]> said something to this effect on 07/09/2001: > How would that be diff from $mins = sprintf("%02d",$QCTAvgSecs/60); > > or would it? I have no idea what $QCTAvgSecs is; it might, or it might not. Intuitively, though, I would say that no matter what $QCTA

Re: floor

2001-07-09 Thread Christopher Zukowski
How would that be diff from $mins = sprintf("%02d",$QCTAvgSecs/60); or would it? At 01:46 PM 7/9/2001, darren chamberlain wrote: >Thomas Jakub <[EMAIL PROTECTED]> said something to this effect on 07/09/2001: >> in c++ you can floor a variable to drop the decimal >> points. How can you do this

Re: Use CGI.pm or Parse it in the script?

2001-07-09 Thread Curtis Poe
--- "G.P.Gaudreault" <[EMAIL PROTECTED]> wrote: > All, > > Which is faster, using the CGI.pm param function to get form input, or parsing out >the hash > within my script? I've got a script that currently uses a lot of system resources, >and I'm > looking for ways to optimize it. [snip] > Is

Re: floor

2001-07-09 Thread darren chamberlain
Thomas Jakub <[EMAIL PROTECTED]> said something to this effect on 07/09/2001: > in c++ you can floor a variable to drop the decimal > points. How can you do this with perl? Use the int function (perldoc -f int). my $pi = 3.1415927; print int $pi; # prints 3 (darren) -- Westheimer's Discove

RE: floor

2001-07-09 Thread Camilo Gonzalez
Use integer, e.g. print "her age is integer($age)"; The function will round up to the next highest number. -Original Message- From: Thomas Jakub [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 3:36 PM To: [EMAIL PROTECTED] Subject: floor in c++ you can floor a variable to drop

floor

2001-07-09 Thread Thomas Jakub
in c++ you can floor a variable to drop the decimal points. How can you do this with perl? __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/

Use CGI.pm or Parse it in the script?

2001-07-09 Thread G.P.Gaudreault
All, Which is faster, using the CGI.pm param function to get form input, or parsing out the hash within my script? I've got a script that currently uses a lot of system resources, and I'm looking for ways to optimize it. I have the following subroutine in my script: sub getform {$buf

Re: Checking Form input.

2001-07-09 Thread Jason Purdy
Well, I posted my method recently (see Re: Required Fields Module), BUT fliptop's methodology is better if your form has a group of checkboxes with the same name or a multiple selection box (one example I didn't think of that you pointed out, flipdog :)) or some other form design where your query

Re: telling time in perl

2001-07-09 Thread fliptop
Thomas Jakub wrote: > > How can I tell how much time a program has been > running for in a perl script? I tried to do $time01 = > localtime() and $time02 = localtime() and then > subtract $time01 from $time02, but I always get zero, > even though there was about five or so minutes of > activity

Re: how to upload a file through an html form?

2001-07-09 Thread Jason Purdy
One thing that snagged me with printing to a filehandle is the binmode. I was uploading an Excel spreadsheet and writing it, but it would become corrupted (b/c it's a binary file). So if you're dealing with binary files (and according to the docs, if your system knows the difference [which for m

Re: Required Fields Module

2001-07-09 Thread fliptop
Jason Purdy wrote: > > Found a link that described how to do this on the JavaScript side: > http://www.webdeveloper.com/javascript/js_form_example.html adequate, but useless if the user has javascript disabled in their browser. a good choice *only* if it's an internal application where you can

Re: Required Fields Module

2001-07-09 Thread Jason Purdy
I posted the original message, but my code is not an alternative to CGI - it's a supplement to validate a form-fed CGI script and that certain elements were filled out by the user. It requires CGI, actually. Found a link that described how to do this on the JavaScript side: http://www.webdevelop

Re: file modification dates

2001-07-09 Thread Gabor Szabo
Hi Thomas, use the stat function with the file. you canget more information by typing perldoc -f utime and perldoc -f stat reagrds -- Gabor On 2001.07.09 21:13 Thomas Jakub wrote: > I'm trying to see when a file was last modified. > Here's the code segment... > > open filename, ">temp"; > #r

telling time in perl

2001-07-09 Thread Thomas Jakub
How can I tell how much time a program has been running for in a perl script? I tried to do $time01 = localtime() and $time02 = localtime() and then subtract $time01 from $time02, but I always get zero, even though there was about five or so minutes of activity in between the parts where $time01

Re: Shifting bits

2001-07-09 Thread Gabor Szabo
you can also type in perldoc perlop and search for bitwise in the file or you can also search "bitwise" on www.perldoc.com there you can find explanation on how these things work. -- Gabor On 2001.07.09 20:26 Camilo Gonzalez wrote: > Yes, > > >> and << > > -Original Message- > Fro

file modification dates

2001-07-09 Thread Thomas Jakub
I'm trying to see when a file was last modified. Here's the code segment... open filename, ">temp"; #random time consumming statements go here $then = time; utime $then, $then, filename; print $then; close filename; The problem is, every time I do this, I don't get the time of when I last added

RE: Shifting bits

2001-07-09 Thread Camilo Gonzalez
Yes, >> and << -Original Message- From: Brian Jackson [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 12:26 PM To: [EMAIL PROTECTED] Subject: Shifting bits Unfortunately I don't have any Perl books available to me at this time and I am trying to find the answer to this on the we

Shifting bits

2001-07-09 Thread Brian Jackson
Unfortunately I don't have any Perl books available to me at this time and I am trying to find the answer to this on the web, but have had no luck thus far...does anyone know if there is a shift operator in Perl that allow me to shift bits.

Re: Checking Form input.

2001-07-09 Thread fliptop
Marcus Willemsen wrote: > > Probably I got it all wrong but can someone give me some general advise how > to handle such problems? Use a JavaScript to check the input? you can use javascript, but that won't work if the user has disabled javascript in their browser. i use a 3-step process to val

Re: how to upload a file through an html form?

2001-07-09 Thread Curtis Poe
--- fliptop <[EMAIL PROTECTED]> wrote: > > Not true. Printing the file contents directly to the screen is a common method of >testing > whether > > or not the file upload was successful and has nothing to do with whether or not >Hytham was > > properly uploading the file. > > yes, but the orig

Re: how to upload a file through an html form?

2001-07-09 Thread fliptop
Curtis Poe wrote: > > --- fliptop <[EMAIL PROTECTED]> wrote: > > you need to tell perl to print the uploaded file to a file on the hard > > drive: > > [ snip ] > > Not true. Printing the file contents directly to the screen is a common method of >testing whether > or not the file upload was s

Re: Required Fields Module

2001-07-09 Thread Curtis Poe
--- fliptop <[EMAIL PROTECTED]> wrote: > > > > since I don't use CGI.pm for basic web stuff, I have my own function > > > > getting values out of the query string, and it was only giving me the last > > > > value of MultipleSelectMenu -- bad :( > > > > > >that's why you'll be better off just alway

Re: how to upload a file through an html form?

2001-07-09 Thread Curtis Poe
--- fliptop <[EMAIL PROTECTED]> wrote: > Hytham Shehab wrote: > > > > hi gurus, > > i use the upload() function in the CGI module to get a file in the > > filefield tag, but i don't understand how to get it to the server? > > $fh=$q->upload('file_to_be_uploaded'); > > while(<$fh>){ > > pr

Re: Apache configuration

2001-07-09 Thread fliptop
Guillaume Denizot wrote: > > Hello, excuse me for my english but... > I have installed successfuly Apache, Perl, MySQL (DBI) and > DBD-mysql. > test.pl is a perl file which run. > What should I write in my home page: > ? > > How should I configure httpd.conf to execute it? in http.conf: A

Checking Form input.

2001-07-09 Thread Marcus Willemsen
Hi all, I'have almost no experience in programming or writing CGI Scripts so perhaps my question isn't very clever. My problem concern the evaluation of From Input. What's the best way to check wheather a field contains input or not. What I want to do, is to set up a form that has to be filled

Re: how to upload a file through an html form?

2001-07-09 Thread fliptop
Hytham Shehab wrote: > > hi gurus, > i use the upload() function in the CGI module to get a file in the > filefield tag, but i don't understand how to get it to the server? > $fh=$q->upload('file_to_be_uploaded'); > while(<$fh>){ > print; > } you need to tell perl to print the uploaded f

how to upload a file through an html form?

2001-07-09 Thread Hytham Shehab
hi gurus, i use the upload() function in the CGI module to get a file in the filefield tag, but i don't understand how to get it to the server? $fh=$q->upload('file_to_be_uploaded'); while(<$fh>){ print; } but nothing happens, i keep searching about the file in the directory that should be

Apache configuration

2001-07-09 Thread Guillaume Denizot
Hello, excuse me for my english but... I have installed successfuly Apache, Perl, MySQL (DBI) and DBD-mysql. test.pl is a perl file which run. What should I write in my home page: ? How should I configure httpd.conf to execute it? Thanks... __

Re: Required Fields Module

2001-07-09 Thread Aaron Craig
At 07:03 09.07.2001 -0700, Ask Bjoern Hansen wrote: >Aaron Craig <[EMAIL PROTECTED]> writes: > >[...] > > test.cgi?MultipleSelectMenu=1&MultipleSelectMenu=2 > > > > since I don't use CGI.pm for basic web stuff, I have my own function > > getting values out of the query string, and it was only givi

Re: Required Fields Module

2001-07-09 Thread Ask Bjoern Hansen
Aaron Craig <[EMAIL PROTECTED]> writes: [...] > test.cgi?MultipleSelectMenu=1&MultipleSelectMenu=2 > > since I don't use CGI.pm for basic web stuff, I have my own function > getting values out of the query string, and it was only giving me the last > value of MultipleSelectMenu -- bad :( that

Re: newbie question

2001-07-09 Thread Jason Purdy
I'm not familiar with WinCGI, but your code is missing the important shebang line. I have Apache running on my Windoze box and my shebang is: #!\Perl\bin\perl Everything's off my C drive and the DOS path to Perl is: C:\Perl\bin\perl. Jason - Original Message - From: "nila devaraj" <[E

Re: Password protected area using perl.

2001-07-09 Thread fliptop
Gary Stainburn wrote: > > If you just want restricted access, then Apache and most other servers have > some form of user ID/Password control to restricted areas of a web site. if you are running apache, then you should also consider the mod_perl way of doing it. with mod_perl (or .htaccess, fo

Re: Deleting rows using checkboxes and PostgreSQL

2001-07-09 Thread darren chamberlain
skazat <[EMAIL PROTECTED]> said something to this effect on 07/09/2001: > use the CGI.pm module, checkbox values will come back as an array, so do > something like, > > > my $q = new CGI; > my @checked_values = $q->param('whatever_row_i_want_to_chuck'); > > > then use the DBI module to chuck

Re: Password protected area using perl.

2001-07-09 Thread Aaron Craig
I can at least point you toward the modules I would use for this process >At 12:01 09.07.2001 +0200, you wrote: >Dear subscribers, > >I am working out an idea for a (set of) perl scripts that would provide >the following: > >* A login form asking for a unique username/password combination; CGI.

Password protected area using perl.

2001-07-09 Thread Martijn van Exel
Dear subscribers, I am working out an idea for a (set of) perl scripts that would provide the following: * A login form asking for a unique username/password combination; * Validating the user input (using a stored user database) and redirecting the user accordingly; * Maintaining the state, i

Re: Required Fields Module

2001-07-09 Thread Aaron Craig
At 23:14 08.07.2001 -0400, Jason Purdy wrote: >I forgot the print $query->header part of the code. I also updated the code >to accept '0' values by grepping within the keywords. I currently don't >have to worry about multivalued parameters - I don't design my forms that >way. Ouch, I just got

RE: POP3 Module

2001-07-09 Thread Greg
Yay! I'm stupid!! Just found why it didn't show :) Thanks!! Greg. -> I try to use the NET:POP3 to retreive headers mails on a pop3 -> server, but I -> can't retreive all header data : -> By exemple I try to retreive a header of an message using the -> return-path, -> and in the informations I

NET:POP3 Module

2001-07-09 Thread Greg
I try to use the NET:POP3 to retreive headers mails on a pop3 server, but I can't retreive all header data : By exemple I try to retreive a header of an message using the return-path, and in the informations I can find, I don't see this value, just: "Return-Path: Received: from " For the sender in

Re: Deleting rows using checkboxes and PostgreSQL

2001-07-09 Thread skazat
use the CGI.pm module, checkbox values will come back as an array, so do something like, my $q = new CGI; my @checked_values = $q->param('whatever_row_i_want_to_chuck'); then use the DBI module to chuck it from the SQL table, use DBI; my $dbh = DBI->connect("$data_source", $user, $pass);