Re: Submitting Form Passes Old Values

2002-08-15 Thread Hal Vaughan

I'm a bit confused -- I thought I was posting through a USENet server, and I 
guess it's actually more like a mailing list.  I guess I need to find a FAQ 
to check and see what I missed.

Anyway, you've hit it.  I got a few answers on IRC somewhere around 4 am, and 
after waking up and thinking it over, I fixed the problem by changing my 
decleration from our @myparms = CGI::param() to my @myparms = CGI::param().  
(Someone on IRC said to try read(STDIN, $buffer, $ENV{CONTENT_LENGTH}):, 
which showed me the data passed to the script was NOT duplicated -- so we 
could see the duplication had to be within perl.)

Since I had two simple 3 line subroutines, I had declared variables in that 
script with OUR.  Once I made the change noted above, everything worked fine.

And yes, I am using mod_perl.  I didn't realize there was a difference in 
behavior like that.  It's working now.

Thank you for your help!

Hal


On Wednesday 14 August 2002 06:04 pm, you wrote:
 In other words what Rob is asking ;-) is are you using mod_perl or plain
 cgi, and in the case of plain CGI, what browser are you using?  what
 version of that browser?  and have you tried other browsers, on other
 OSes, on other computers with what results???

 http://danconia.org

 Hanson, Rob wrote:
  Running Perl as a CGI will *not* cache any variables (or anything else).
  Each time the script is called the Perl executable will be started, and
  when finished it will free all memory that it was using.  If you are
  using mod_perl it is a little different.  mod_perl will cache a script
  (and any modules used) in memory so that it starts up faster the next
  time it is called, and it *can* cache variables if your code isn't
  written with mod_perl in mind.
 
  I hope that helps.
 
  Rob
 
  -Original Message-
  From: Hal Vaughan [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, August 13, 2002 11:27 PM
  To: [EMAIL PROTECTED]
  Subject: Submitting Form Passes Old Values
 
 
  I've got what amounts to a control panel or preferences settings system
  that
 
  uses HTML and perl scripts.  I'm running this on Mandrake Linux 8.2 with
  Apache 1.3.  I have two pages that interact with each other.  The 2nd
  page, the one I'm having problems with, has a number of checkboxes, drop
  down menus, and radio buttons.  The first time I press Submit, all the
  values are passed properly to the called perl script.  The problem comes
  in after that.  When I use this page again, (both second and later times)
  and press Submit, the page passes all the form elements (or rather
  their values) again, but twice.  It keeps building, but I'm not sure if
  it adds another copy of all the values each time I submit the page or
  not.
 
  In other words, I press submit once, I get one set of values, and am
  returned to a front page.  I go from the front page back to the page with
  the form and press submit again, and I get two sets of the same values. 
  I just keep getting more and more values.
 
  How are these values staying in memory?  How can I purge them?
 
  Thanks.
 
  Hal


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Weekly list FAQ posting

2002-08-15 Thread casey

NAME
beginners-faq - FAQ for the beginners-cgi mailing list

1 -  Administriva
  1.1 - I'm not subscribed - how do I subscribe?

Send mail to [EMAIL PROTECTED]

You can also specify your subscription email address by sending email to
(assuming [EMAIL PROTECTED] is your email address):

[EMAIL PROTECTED].

  1.2 -  How do I unsubscribe?

Now, why would you want to do that? Send mail to
[EMAIL PROTECTED], and wait for a response. Once you
reply to the response, you'll be unsubscribed. If that doesn't work,
find the email address which you are subscribed from and send an email
like the following (let's assume your email is [EMAIL PROTECTED]):

[EMAIL PROTECTED]

  1.3 - There is too much traffic on this list. Is there a digest?

Yes. To subscribe to the digest version of this list send an email to:

[EMAIL PROTECTED]

To unsubscribe from the digest, send an email to:

[EMAIL PROTECTED]

  1.4 - Is there an archive on the web?

Yes, there is. It is located at:

http://archive.develooper.com/beginners-cgi%40perl.org/

  1.5 - How can I get this FAQ?

This document will be emailed to the list once a month, and will be
available online in the archives, and at http://beginners.perl.org/

  1.6 - I don't see something in the FAQ, how can I make a suggestion?

Send an email to [EMAIL PROTECTED] with your suggestion.

  1.7 - Is there a supporting website for this list?

Yes, there is. It is located at:

http://beginners.perl.org/

  1.8 - Who owns this list?  Who do I complain to?

Casey West owns the beginners-cgi list. You can contact him at
[EMAIL PROTECTED]

  1.9 - Who currently maintains the FAQ?

Kevin Meltzer, who can be reached at the email address (for FAQ
suggestions only) in question 1.6

  1.10 - Who will maintain peace and flow on the list?

Casey West, Kevin Meltzer and Ask Bjoern Hansen currently carry large,
yet padded, clue-sticks to maintain peace and order on the list. If you
are privately emailed by one of these folks for flaming, being
off-topic, etc... please listen to what they say. If you see a message
sent to the list by one of these people saying that a thread is closed,
do not continue to post to the list on that thread! If you do, you will
not only meet face to face with a XQJ-37 nuclear powered pansexual
roto-plooker, but you may also be taken off of the list. These people
simply want to make sure the list stays topical, and above-all, useful
to Perl/CGI beginners.

  1.11 - When was this FAQ last updated?

Sept 07, 2001

2 -  Questions about the 'beginners-cgi' list.
  2.1 - What is the list for?

A list for beginning Perl programmers to ask questions in a friendly
atmosphere. The topic of the list is, of course, CGI with Perl.

  2.2 - What is this list _not_ for?

* SPAM
* Homework
* Solicitation
* Things that aren't Perl related
* Non Perl/CGI questions or issues
* Lemurs
  2.3 - Are there any rules?

Yes. As with most communities, there are rules. Not many, and ones that
shouldn't need to be mentioned, but they are.

* Be nice
* No flaming
* Have fun
  2.4 - What topics are allowed on this list?

Basically, if it has to do with Perl/CGI , then it is allowed. If your
question has nothing at all to do with Perl/CGI, it will likely be
ignored.

  2.5 - I want to help, what should I do?

Subscribe to the list! If you see a question which you can give an
idiomatic and Good answer to, answer away! If you do not know the
answer, wait for someone to answer, and learn a little.

  2.6 - Is there anything I should keep in mind while answering?

We don't want to see 'RTFM'. That isn't very helpful. Instead, guide the
beginner to the place in the FM they should R :)

  2.7 - I don't want to post a question if it is in an FAQ. Where should I
look first?

Look in the FAQ! Get acquainted with the 'perldoc' utility, and use it.
It can save everyone time if you look in the Perl FAQs first, instead of
having a list of people refer you to the Perl FAQs :) You can learn
about 'perldoc' by typing:

perldoc perldoc

At your command prompt. You can also view documentation online at:

http://www.perldoc.com and http://www.perl.com

3 - Other Resources
  3.1 - What other websites may be useful to a beginner ?

* Perl Home Page - http://www.perl.com
* PerlMonks - http://www.perlmonks.org
* Perldoc - http://www.perldoc.com
* Perl Archives - http://www.perlarchives.com
  3.2 - What resources may be harmful to a beginner?

Beware of Perl4-like code-- You might find some script archives and
unauthorized mirrors with old Perl4 versions of Selena Sol and Matt
Wright scripts. Don't use those scripts. They are outdated and may even
in some cases contain bugs or security problems since many may not have
been updated in 

database update

2002-08-15 Thread Rob

The following line works from a script run from the command line on the
server...

$sql = UPDATE data SET CustNo = $custNo, PIN = $pin, Notes = '$notes'
WHERE CustNo = $custNo and PIN = $pin and CustName = '$custName' and
Serial = '$serial';

but when run from cgi I get the following error...

ERROR: parser: parse error at or near ,

I'm using the Pg module, any idea why it won't run from the web?

Rob

Good judgement comes from experience, and experience -
well, that comes from poor judgement.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: database update

2002-08-15 Thread Mike(mickako)Blezien

Rob wrote:
 
 The following line works from a script run from the command line on the
 server...
 
 $sql = UPDATE data SET CustNo = $custNo, PIN = $pin, Notes = '$notes'
 WHERE CustNo = $custNo and PIN = $pin and CustName = '$custName' and
 Serial = '$serial';
 
 but when run from cgi I get the following error...
 
 ERROR: parser: parse error at or near ,
 
 I'm using the Pg module, any idea why it won't run from the web?

Try single or double quotes around your varilables, IE.. CustNo = '$custNo', PIN
= '$pin'
or read up on placeholders.
-- 
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Bus Phone:  1(985)902-8484
Cellular:   1(985)320-1191
Fax:1(985)345-2419
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: database update

2002-08-15 Thread Bob Showalter

 -Original Message-
 From: Rob [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 15, 2002 2:24 PM
 To: [EMAIL PROTECTED]
 Subject: database update
 
 
 The following line works from a script run from the command 
 line on the
 server...
 
 $sql = UPDATE data SET CustNo = $custNo, PIN = $pin, Notes = '$notes'
 WHERE CustNo = $custNo and PIN = $pin and CustName = '$custName' and
 Serial = '$serial';
 
 but when run from cgi I get the following error...
 
 ERROR: parser: parse error at or near ,
 
 I'm using the Pg module, any idea why it won't run from the web?

Are you dumping out $sql somewhere? Perhaps $custNo is blank, which would
give you:

   UPDATE data SET CustNo = , PIN = ...
   ^^ syntax error here

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




mysql problem

2002-08-15 Thread Jim Lundeen

ok, i just setup a new server (redhat 7.3) and my guy says that the
dbd/dbi stuff is configured for perl-to-mysql connectivity, but i get
the following error message in my error log each time i try to run a
script from either the command line or via the browser:

---
install_driver(mysql) failed: Can't locate DBD/mysql.pm in INC (INC
contains: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1
/usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.6.1/i386-linux
/usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at (eval
3) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: ExampleP, Pg, Proxy.
 at /home/domaincentric/mcp/www/menu.cgi line 13
---

perhaps my script is the problem?  here's some sample code:

---
 $cgi = new CGI;
 $DSN = DBI:mysql:database=mcp;
 $dbh = DBI-connect($DSN, theusername,
thepassword) or die Unable to connect to the Control Panel
database(s);

$mysql_query= qq{SELECT ITEM_ID, ITEM_NAME, SECURITY_LEVEL FROM
menuitems WHERE ACTIVE='Y' AND CATEGORY='$CATEGORY' ORDER BY ITEM_NAME
ASC};
$sth = $dbh-prepare($mysql_query);

$sth-execute();

while($ref = $sth-fetchrow_hashref())
  {
$ITEM_ID   = $ref-{'ITEM_ID'};
$ITEM_NAME = $ref-{'ITEM_NAME'};

  ...
  }
$sth-finish();



if anyone has suggestions, please advise.   thanks!

jim



Re: mysql problem

2002-08-15 Thread Mike(mickako)Blezien

Jim Lundeen wrote:
 ok, i just setup a new server (redhat 7.3) and my guy says that the
 dbd/dbi stuff is configured for perl-to-mysql connectivity, but i get
 the following error message in my error log each time i try to run a
 script from either the command line or via the browser:
 
 ---
 install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
 contains: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1
 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1
 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl
 /usr/lib/perl5/vendor_perl/5.6.1/i386-linux
 /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at (eval
 3) line 3.
 Perhaps the DBD::mysql perl module hasn't been fully installed,
 or perhaps the capitalisation of 'mysql' isn't right.
 Available drivers: ExampleP, Pg, Proxy.
  at /home/domaincentric/mcp/www/menu.cgi line 13

Make sure the DBD::mysql module is also installed. The DBI is the API that uses
the DBD::mysql drives.
-- 
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Bus Phone:  1(985)902-8484
Cellular:   1(985)320-1191
Fax:1(985)345-2419
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: mysql problem

2002-08-15 Thread Kevin Meltzer

Easy way to check is:

perl -MDBD::mysql -e1

Cheers,
Kevin

On Thu, Aug 15, 2002 at 03:44:23PM -0500, Mike(mickako)Blezien ([EMAIL PROTECTED]) 
said something similar to:
 Jim Lundeen wrote:
  ok, i just setup a new server (redhat 7.3) and my guy says that the
  dbd/dbi stuff is configured for perl-to-mysql connectivity, but i get
  the following error message in my error log each time i try to run a
  script from either the command line or via the browser:
  
  ---
  install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
  contains: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1
  /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1
  /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl
  /usr/lib/perl5/vendor_perl/5.6.1/i386-linux
  /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at (eval
  3) line 3.
  Perhaps the DBD::mysql perl module hasn't been fully installed,
  or perhaps the capitalisation of 'mysql' isn't right.
  Available drivers: ExampleP, Pg, Proxy.
   at /home/domaincentric/mcp/www/menu.cgi line 13
 
 Make sure the DBD::mysql module is also installed. The DBI is the API that uses
 the DBD::mysql drives.

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
My PID is Inigo Montoya. You kill -9 my parent process. Prepare to vi.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




perl module problem

2002-08-15 Thread stuv48ac

Hi I have a question please. My ISP have not instaled a Perl Module whitch I need for 
my script. So my script doesn't work. I am a programer so I remember it is a way to 
add functions (methods) from that library to the script and you not need that library. 
Your script will get the methosds form his source. Am I right?
10x




---
Runbox Mail Manager (free trial version - this tag is removed upon subscription)
Try your own premium email account for free at http://111.runbox.com
100MB storage, no ads, fast webmail, access on any device, retrieve and filter email.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: mysql problem

2002-08-15 Thread fliptop

On Thu, 15 Aug 2002 at 16:37, Jim Lundeen opined:

JL:ok, i just setup a new server (redhat 7.3) and my guy says that the
JL:dbd/dbi stuff is configured for perl-to-mysql connectivity, but i get
JL:the following error message in my error log each time i try to run a
JL:script from either the command line or via the browser:
JL:
JL:---
JL:install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC

is the DBD::mysql module installed?  it seems not.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Probably a simple problem

2002-08-15 Thread Patricia Gillard

Probably a simple problem, hopefully with a simple answer.

I recently moved my web domain to a new host service and suddenly my scripts
don't work.  The scripts were ones I had downloaded from Matt's Script
Archive, and they worked fine on a previous server.  I changed the /home
directory correctly, from info from the host, and the path to Perl, and the
scripts load but don't excute correctly.  The problem is with reading and
writing text files.

What I have learned about Perl at the new server is that it is Perl version
5.005_03, mod_perl1.25 module on a Sun Colbat server with Apache 1.3.2.  [I
hope that means something to someone.]  I suspect that my scripts need to be
modified to work at this new server.  I am willing to learn more about Perl
to get my scripts to work, and to that end I found documentation at
http://www.perldoc.com/perl5.005_03/.  I was wondering if you could provide
some confirmation that I am on the right path.

One script that doesn't work well simply reads text files (that are included
in a webpage with SSI) and loads them into a textbox so they can be edited,
and then writes the change back to the text file when 'submit' is clicked.
Simple enough, but at the new server it reads, but it does not write.  I
don't think it is a problem with permissions; I've set them with WS_FTP.  I
could attach the script if it would help, but what I really want to know is
are there radical differences in Perl version 5.005_03 or mod_perl that have
to be made?  Any ideas why it would not overwrite the files?


Patty



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]