Re: cgi and perl database interaction

2009-12-02 Thread Paweł Prędki



Greg Jetter pisze:

On Tuesday 01 December 2009 2:52:38 pm Paweł Prędki wrote:

Hello,
I have a website that uses a php engine for news generation and,
basically, most of the other pages. It uses a MySQL database to store
the majority of the page contents (i.e. news).

However, I've written before that I've started using simple CGI scripts
in Perl to make some activities automatic (i.e. statistics updates,
standings updates - it's a sports-related website :) ).

At first, I used the Storable module and kept all the data in flat files
but it generally is not the best solution so I moved to DBI.

Now, the thing is that the PHP scripts also connect to the database and,
presumably, uphold the connection over the duration of the session so as
not to disconnect and reconnect continually when the user browses the
website.

My question is - is it possible to do the same thing with those CGI
scripts? At the moment, each script 'requires' a module where a function
is defined which returns a database handle upon connecting to the
database. This is not an efficient solution and I would like to change
that. There is no mod_perl running on the server but maybe there is a
way to keep the connection via some Apache mechanisms. I'm not
experienced with the server operation that much so forgive me if what I
wrote is hogwash ;)
Cheers,
Pawl


There  is absolutely no  reason to keep a  connection to the database  active 
once the query has finished and the results are fetched and processed , doing 
so  only ties up system resources and memory. The default  for  Mysql in a  
un- altered server  install is 50 concurrent connections.  A web site can very 
easily surpass this  if the  connections are  kept alive. The  behavior of the  
DBI module returning a handle that you interact  with  is the most efficient use 
of  resources .   And I'm pretty sure if you research it you will find that PHP 
does the same thing as PHP is modled after Perl on many levels. Once the 
object is created it persist for the duration of the  script  or until it is   
destroyed with a call to disconnect. Or you risk  getting "unable to connect , 
too many  connections" from your MySql server. and if you  have not  
programmed  to handle the error , you  will get  silent failure with  the  
page  just hanging up  never completing a read or write.  


good luck

Greg



If that's the case then there is no problem. I thought that the database 
connection persists until the user navigates away from the site (there 
is some kind of an inactivity timeout). Taking into consideration that 
there are many sql queries from one single page consisting of many 
separate php 'modules' I would assume that each of the separate files 
doesn't connect to the db on its own but rather uses one connection.


I guess that it is possible for the first include in each php file to 
create a database connection which is then visible to all the submodules 
included in the same file. I need to look into the php mechanism more 
closely.


Thanks for your input.
Pawel

--
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/




Re: cgi and perl database interaction

2009-12-02 Thread Paweł Prędki

Thanks, I'll see if I'm able to use that information.

Rene Schickbauer pisze:

Paweł Prędki wrote:

I will look into the HTTP::Server::Simple::CGI and your framework but 
I'm not sure I'm knowledgeable enough to deal with that :) I mean I 
don't really get the idea of a phps being only proxies. At the moment 
a sample php file where I include my own cgi script looks like this:


HTTP::Server::Simple::CGI is rather simple, really. You could basically 
put in your CGI scripts with a few simple modifications.


Maplat is based on that module, too. Although it has more a bunch more 
features, it still shares the same simple-to-use principles, except you 
most likely use the included Template Toolkit module to render the pages.


However, there are also a lot of files where there is much more php 
code and no perl code as well as small panels written in pure perl :) 
How would the distinction of what serves which pages work?


The perl scripts are in a separate directory, so you could use 
mod_rewrite or similar.


You can also use a single PHP script to proxy multiple perl pages, if 
you use links like that:


http://yourserver/proxy.php?get=nameofscript

LG
rene



--
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/




Re: cgi and perl database interaction

2009-12-01 Thread Greg Jetter
On Tuesday 01 December 2009 2:52:38 pm Paweł Prędki wrote:
> Hello,
> I have a website that uses a php engine for news generation and,
> basically, most of the other pages. It uses a MySQL database to store
> the majority of the page contents (i.e. news).
>
> However, I've written before that I've started using simple CGI scripts
> in Perl to make some activities automatic (i.e. statistics updates,
> standings updates - it's a sports-related website :) ).
>
> At first, I used the Storable module and kept all the data in flat files
> but it generally is not the best solution so I moved to DBI.
>
> Now, the thing is that the PHP scripts also connect to the database and,
> presumably, uphold the connection over the duration of the session so as
> not to disconnect and reconnect continually when the user browses the
> website.
>
> My question is - is it possible to do the same thing with those CGI
> scripts? At the moment, each script 'requires' a module where a function
> is defined which returns a database handle upon connecting to the
> database. This is not an efficient solution and I would like to change
> that. There is no mod_perl running on the server but maybe there is a
> way to keep the connection via some Apache mechanisms. I'm not
> experienced with the server operation that much so forgive me if what I
> wrote is hogwash ;)
> Cheers,
> Pawl

There  is absolutely no  reason to keep a  connection to the database  active 
once the query has finished and the results are fetched and processed , doing 
so  only ties up system resources and memory. The default  for  Mysql in a  
un- altered server  install is 50 concurrent connections.  A web site can very 
easily surpass this  if the  connections are  kept alive. The  behavior of the  
DBI module returning a handle that you interact  with  is the most efficient 
use 
of  resources .   And I'm pretty sure if you research it you will find that PHP 
does the same thing as PHP is modled after Perl on many levels. Once the 
object is created it persist for the duration of the  script  or until it is   
destroyed with a call to disconnect. Or you risk  getting "unable to connect , 
too many  connections" from your MySql server. and if you  have not  
programmed  to handle the error , you  will get  silent failure with  the  
page  just hanging up  never completing a read or write.  

good luck

Greg



--
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/




Re: cgi and perl database interaction

2009-12-01 Thread Paweł Prędki

Hi!
Thanks for the quick reply. I know it would be much simpler if I just
installed mod_perl and some kind of a framework (I've started learning
Mason and I think I would be able to do what I want using this solution
) and rewrote the whole webpage but that's too much work and it's really
not necessary :) The site is not big, we don't have much traffic so such
inefficiencies don't cost us much. I just wanted to know if there was a
straightforward solution to this problem and I figured there could be
problems with such injection of Perl into a php-dominated application :)

I will look into the HTTP::Server::Simple::CGI and your framework but
I'm not sure I'm knowledgeable enough to deal with that :) I mean I
don't really get the idea of a phps being only proxies. At the moment a
sample php file where I include my own cgi script looks like this:



However, there are also a lot of files where there is much more php code
and no perl code as well as small panels written in pure perl :) How
would the distinction of what serves which pages work?

I know that, in the long run, such distinction and such way of doing
things makes little sense but, like I said, I don't want to restructure
the whole site (I want to keep the php engine which is rather useful and
user-friendly) but I want to use my CGI scripts in an efficient way. To
be honest, the most efficient way would be to rewrite those scripts in
php which shouldn't be too big of a problem but I'm really interested in
Perl right now and that's where I stand :)


Rene Schickbauer pisze:

Hi!

Now, the thing is that the PHP scripts also connect to the database 
and, presumably, uphold the connection over the duration of the 
session so as not to disconnect and reconnect continually when the 
user browses the website.


My question is - is it possible to do the same thing with those CGI 
scripts?


CGI scripts are basically scripts executed at the commandline with a few 
parameters and environment variables set (each call normally starts a 
new instance).


You could look into the various web frameworks if and how they solved 
the problem. If you can't install anything on the server besides CGI 
scripts, you're probably out of luck, though.


If you CAN install additional software on the server, mod_perl could be 
the way to go. Or run your own small perl-based server for those pages 
on another port, HTTP::Server::Simple::CGI (or my Maplat-Framework) 
might fit your profile - you may even run them as backend only on 
localhost and use a PHP script as simple proxy 8-)


It really depends on what you're planing in the long run.

LG
Rene




--
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/




Re: cgi and perl database interaction

2009-12-01 Thread Rene Schickbauer

Hi!

Now, the thing is that the PHP scripts also connect to the database and, 
presumably, uphold the connection over the duration of the session so as 
not to disconnect and reconnect continually when the user browses the 
website.


My question is - is it possible to do the same thing with those CGI 
scripts?


CGI scripts are basically scripts executed at the commandline with a few 
parameters and environment variables set (each call normally starts a new 
instance).


You could look into the various web frameworks if and how they solved the 
problem. If you can't install anything on the server besides CGI scripts, 
you're probably out of luck, though.


If you CAN install additional software on the server, mod_perl could be the way 
to go. Or run your own small perl-based server for those pages on another port, 
HTTP::Server::Simple::CGI (or my Maplat-Framework) might fit your profile - you 
may even run them as backend only on localhost and use a PHP script as simple 
proxy 8-)


It really depends on what you're planing in the long run.

LG
Rene

--
#!/usr/bin/perl #99BoB (C)2004 cavac:prg count drink vessel place act1 act2
@a...@argv;$c=$a[0]||99;$b=" ".($a[2]||"bottles")." of ".($a[1]||"beer");$w=" ".
($a[3]||"on the wall").",";do{print"$c$b$w\n$c$b,\n".($a[4]||"take one down").
", ".($a[5]||"pass it around").",\n".--$c."$b$w\n\n";}while($c);print"END!\n";

--
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/




Re: cgi and php database interaction

2009-12-01 Thread Paweł Prędki

I changed the topic of the e-mail. Sorry for the confusion.

Paweł Prędki pisze:

Hello,
I have a website that uses a php engine for news generation and, 
basically, most of the other pages. It uses a MySQL database to store 
the majority of the page contents (i.e. news).


However, I've written before that I've started using simple CGI scripts 
in Perl to make some activities automatic (i.e. statistics updates, 
standings updates - it's a sports-related website :) ).


At first, I used the Storable module and kept all the data in flat files 
but it generally is not the best solution so I moved to DBI.


Now, the thing is that the PHP scripts also connect to the database and, 
presumably, uphold the connection over the duration of the session so as 
not to disconnect and reconnect continually when the user browses the 
website.


My question is - is it possible to do the same thing with those CGI 
scripts? At the moment, each script 'requires' a module where a function 
is defined which returns a database handle upon connecting to the 
database. This is not an efficient solution and I would like to change 
that. There is no mod_perl running on the server but maybe there is a 
way to keep the connection via some Apache mechanisms. I'm not 
experienced with the server operation that much so forgive me if what I 
wrote is hogwash ;)

Cheers,
Pawl



--
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/




cgi and perl database interaction

2009-12-01 Thread Paweł Prędki

Hello,
I have a website that uses a php engine for news generation and, 
basically, most of the other pages. It uses a MySQL database to store 
the majority of the page contents (i.e. news).


However, I've written before that I've started using simple CGI scripts 
in Perl to make some activities automatic (i.e. statistics updates, 
standings updates - it's a sports-related website :) ).


At first, I used the Storable module and kept all the data in flat files 
but it generally is not the best solution so I moved to DBI.


Now, the thing is that the PHP scripts also connect to the database and, 
presumably, uphold the connection over the duration of the session so as 
not to disconnect and reconnect continually when the user browses the 
website.


My question is - is it possible to do the same thing with those CGI 
scripts? At the moment, each script 'requires' a module where a function 
is defined which returns a database handle upon connecting to the 
database. This is not an efficient solution and I would like to change 
that. There is no mod_perl running on the server but maybe there is a 
way to keep the connection via some Apache mechanisms. I'm not 
experienced with the server operation that much so forgive me if what I 
wrote is hogwash ;)

Cheers,
Pawl

--
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/




Database connectivity problem with cgi

2005-04-30 Thread Deepblues
I have a database connetivity problem, I have a cgi script which connects to 
the database.
I tried the CGI script at the command line and its working, it also connects 
to the database. But when I use the front end , it says there is an internal 
error , and gives the "premature end of script headers" output.
I tried to see what the problem is and zeroed down on the database 
connection string.
my database connection string is:

my $dbname='NAME';
my $dbbh= DBI->connect("dbi:Pg:dbname=$dbname", "USERNAME","PASSWD");
if (!dbh){
die "ERR :couldn't open connection:" .$DBI::errstr."\n";
}

Can you point out any error in the above and why it works at the command 
line but not at the front end. 
My script goes like this:
 I have a form where I capture the data insert this data in to a table in my 
database. I am able to capture the data and use it. when I run the script in 
the command line it works and gives me the output . But when I use the html 
form, it somehow doesn't work when there is database connetion. As long as 
there is no database connection. It returns the values of the form and all..
 I am new to all this and kind of confused.. I am posting a part of my 
script below..
This is my test script ::: I am trying to see if I can connect to database . 
I am not sure if my html embedded code is right. Any insights will be 
greatly appreciated.
 
#!/usr/bin/perl

use CGI;
use strict;
use DBI;

 my $form_data = new CGI;


my $name = $form_data->param('name');
my $number = $form_data->param('number');

my $dbname ='NAME';
my $dbh=DBI->connect("dbi:Pg:dbname=$dbname","USERNAME","PASSWD");
if (!$dbh){
die "ERR:couldn't open connection: ".$DBI::errstr."\n";
}

my $count=$dbh->selectrow_array("SELECT COUNT(*)FROM TableName");

$dbh->disconnect;

 print "Content-type: text/html\n\n";

print <http://www.w3.org/TR/html4/stric.dtd";>


 RESULT PAGE 


 Thank you for filling out my form !
 The course details are :
 name : $name
 Number: $number
 No of rows : $count


WEB_PAGE
exit;

 Thank you, 

Deepblues


Re: Database Rows Returned

2005-01-08 Thread Scott R. Godin
Sean Davis wrote:
On Jan 4, 2005, at 11:07 PM, Literatecat wrote:
Hi Sean,
I do already have some of the books that you mention, and I have just 
recently picked up the perl medic to help convert these scripts to the 
latest version of perl.

However, as I already use hidden fields and have started working on 
script generated forms, pattern matching, mysql to mention a few 
things, (although I did see some other things in a book I was flicking 
through last night that will lead to some other questions here, like 
using tk toolkit on the web, perl embed, perl sessions etc) I have 
already altered these script so far that I doubt that copyright exists 
on them anymore.

I just don't understand the concept of what happens when a script 
tries to create multiple pages from one query.  This makes it 
difficult to create the code.  If you say perl DBI then I already have 
a book on its way, and I will just have to wait for it to come in.

The issue here is that there is no concept of creating multiple pages 
for one query.  The query is used to generate only ONE page.  If you 
want to generate another page, you have to generate a new query with new 
parameters.  Consider a "paged" DBI output.  You have a script that 
generates a pages that asks the user what to search for.  The user 
presses submit.  The next script (or a subroutine from the same script, 
depending on your design) processes the query and returns results, but 
only for the first page.  On that same page, you need to have all the 
information from the original database search page as well as a page 
number.  On a submit from this page, you submit back to the second 
script (the same script), but a parameter in this query tells the script 
that it is now to generate page two.  Other information remains the 
same.  Confusing, yes, but that is the nature of the web.  It sounds 
like you might need to take a step back and make a toy example that does 
something plain and simple like acccepting user input and then 
generating output, perhaps using DBI.  If this is going to be a large 
undertaking, I encourage you to look seriously at web development 
modules like CGI::Application, CGI::Builder, Maypole, and the like.

Sean
this is usually done by passing a count and possibly a limit via the url 
of the 2nd request, so that your db request includes  LIMIT y, x or 
somesuch, to limit the request to x number of values starting at y (if I 
correctly remember how that works).

Generally one also need to initially pass an additional request to the 
db in advance of displaying the page (resulting in 2 requests per page 
display) to get the max # of results returned, so that you can test for 
when you need to limit.

--
Scott R. Godin
Laughing Dragon Services
www.webdragon.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Re: Database Rows Returned

2005-01-05 Thread Jay
On Wed, 5 Jan 2005 05:59:47 -0500, Sean Davis <[EMAIL PROTECTED]> wrote:
> 
> On Jan 4, 2005, at 11:07 PM, Literatecat wrote:
> 
> > Hi Sean,
> >
> > I do already have some of the books that you mention, and I have just
> > recently picked up the perl medic to help convert these scripts to the
> > latest version of perl.
> >
> > However, as I already use hidden fields and have started working on
> > script generated forms, pattern matching, mysql to mention a few
> > things, (although I did see some other things in a book I was flicking
> > through last night that will lead to some other questions here, like
> > using tk toolkit on the web, perl embed, perl sessions etc) I have
> > already altered these script so far that I doubt that copyright exists
> > on them anymore.
> >
> > I just don't understand the concept of what happens when a script
> > tries to create multiple pages from one query.  This makes it
> > difficult to create the code.  If you say perl DBI then I already have
> > a book on its way, and I will just have to wait for it to come in.
> 
> The issue here is that there is no concept of creating multiple pages
> for one query.  The query is used to generate only ONE page.  If you
> want to generate another page, you have to generate a new query with
> new parameters.  Consider a "paged" DBI output.  You have a script that
> generates a pages that asks the user what to search for.  The user
> presses submit.  The next script (or a subroutine from the same script,
> depending on your design) processes the query and returns results, but
> only for the first page.  On that same page, you need to have all the
> information from the original database search page as well as a page
> number.  On a submit from this page, you submit back to the second
> script (the same script), but a parameter in this query tells the
> script that it is now to generate page two.  Other information remains
> the same.  Confusing, yes, but that is the nature of the web.  It
> sounds like you might need to take a step back and make a toy example
> that does something plain and simple like acccepting user input and
> then generating output, perhaps using DBI.  If this is going to be a
> large undertaking, I encourage you to look seriously at web development
> modules like CGI::Application, CGI::Builder, Maypole, and the like.
> 
> Sean
> 

Cat,

The issue here is that a cgi script executes anew every time it is
called.  Unless you do something to save state--cgi for making the
script remember something--it will simply repeat what it's done
before.  Simple data can be passed as hidden values, more complex data
structures may require client-side cookies.  In your cgi books, you'll
want to look at saving state, and session management.

How exactly you go about that will depend on what is important to you
with regard to your data, and how you want your user to interact with
it.  The simplest way to appraoch this is by modifying a combination
of perl and SQL.  Put in a hidden field with either a "page" number or
the last row viewed, and then modify the query subroutine to add a
limit clause to the query.  On the first page, you'll use "limit 25",
on the second "limit 25,25" on the third "limit 25,50", etc.  Look up
limit in a mysql reference.  Note, though, that this appraoch will
re-run the query each time.  If a row is added before the current
page, the first item on the page will be a repeat of something the
user has already seen.  Probably, this won't be an issue for you.

If you need to make sure the user sees the info as it was at the time
they made the request, you'll need to save the results somewhere and
iterate through them.  You could pass them as a hidden field if
they're small, but you'll probably want a temporary file somewhere. 
Chek out File::Temp

HTH,

--jay

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Database Rows Returned

2005-01-05 Thread Sean Davis
On Jan 4, 2005, at 11:07 PM, Literatecat wrote:
Hi Sean,
I do already have some of the books that you mention, and I have just 
recently picked up the perl medic to help convert these scripts to the 
latest version of perl.

However, as I already use hidden fields and have started working on 
script generated forms, pattern matching, mysql to mention a few 
things, (although I did see some other things in a book I was flicking 
through last night that will lead to some other questions here, like 
using tk toolkit on the web, perl embed, perl sessions etc) I have 
already altered these script so far that I doubt that copyright exists 
on them anymore.

I just don't understand the concept of what happens when a script 
tries to create multiple pages from one query.  This makes it 
difficult to create the code.  If you say perl DBI then I already have 
a book on its way, and I will just have to wait for it to come in.
The issue here is that there is no concept of creating multiple pages 
for one query.  The query is used to generate only ONE page.  If you 
want to generate another page, you have to generate a new query with 
new parameters.  Consider a "paged" DBI output.  You have a script that 
generates a pages that asks the user what to search for.  The user 
presses submit.  The next script (or a subroutine from the same script, 
depending on your design) processes the query and returns results, but 
only for the first page.  On that same page, you need to have all the 
information from the original database search page as well as a page 
number.  On a submit from this page, you submit back to the second 
script (the same script), but a parameter in this query tells the 
script that it is now to generate page two.  Other information remains 
the same.  Confusing, yes, but that is the nature of the web.  It 
sounds like you might need to take a step back and make a toy example 
that does something plain and simple like acccepting user input and 
then generating output, perhaps using DBI.  If this is going to be a 
large undertaking, I encourage you to look seriously at web development 
modules like CGI::Application, CGI::Builder, Maypole, and the like.

Sean
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Re: Database Rows Returned

2005-01-04 Thread Literatecat
Hi Sean,
I do already have some of the books that you mention, and I have just 
recently picked up the perl medic to help convert these scripts to the 
latest version of perl.

However, as I already use hidden fields and have started working on script 
generated forms, pattern matching, mysql to mention a few things, (although 
I did see some other things in a book I was flicking through last night that 
will lead to some other questions here, like using tk toolkit on the web, 
perl embed, perl sessions etc) I have already altered these script so far 
that I doubt that copyright exists on them anymore.

I just don't understand the concept of what happens when a script tries to 
create multiple pages from one query.  This makes it difficult to create the 
code.  If you say perl DBI then I already have a book on its way, and I will 
just have to wait for it to come in.

Thank for your assistance
Cat
- Original Message - 
From: "Sean Davis" <[EMAIL PROTECTED]>
To: "Literatecat" <[EMAIL PROTECTED]>
Cc: 
Sent: Wednesday, January 05, 2005 12:40 PM
Subject: Re: Database Rows Returned


In order to do this, you will need to have some way of determining where 
you are in the count of pages, number of rows, etc., so you will need to 
store some stuff in hidden fields on your page (or in the query string). 
Also, based on those values, you will need to generate a page and make a 
way to move from one page to the next.  This is a tedious process, but it 
isn't difficult.  However, you don't necessarily need to reinvent the 
wheel.  If you incorporate a data model into your design, like Class::DBI, 
you can take advantage of some of their extension modules, like 
Class::DBI::Pager. Unfortunately, any solution here will require learning 
a fair amount about how your existing code works and how to generate CGI 
forms.  Again, none of this is hard, but I would suggest getting a CGI 
book if all of the above terminology (like hidden fields) sounds foreign.

Sean
- Original Message - 
From: "Literatecat" <[EMAIL PROTECTED]>
To: "Sean Davis" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, January 04, 2005 7:29 PM
Subject: Re: Database Rows Returned


Hi Sean,
The max_rows_returned is set in the setup file, but it simply determines 
the number of rows per page.  Then when it reads line by line that there 
are more than the predetermined maximum rows per page, it prints the 
warning that the number of rows have been exceeded, and suggests refining 
the search parameters.
In this case, could refining search parameters be as simple as setting a 
limit in the SQL query?

Problem is that I want to be able to pick up all the rows although not 
all on the same page, there must be some way of getting it to change to 
creating a new page with the next line read exceeding the max rows, and 
so on till the search parameter is filled.  Then placing the link to the 
next set of "25" for instance at the bottom of the page instead of 
suggested that the search be refined.
Unfortunately, CGI scripts cannot make decisions like "make a new page". 
Their only job is to generate ONE HTML page based on input from the 
request. At each page generation, you have to provide enough information 
on the page so that the next request (based on a submit button click, for 
example) allows the script to generate the next page when it runs again 
(eg., you have to tell the script what page number in a multiple-page 
output to generate; you can do this with form parameters).

You can see this in operation at 
http://www.etheria.com.au/cgi-bin/web_store.pl?



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Re: Database Rows Returned

2005-01-04 Thread Sean Davis
In order to do this, you will need to have some way of determining where you 
are in the count of pages, number of rows, etc., so you will need to store 
some stuff in hidden fields on your page (or in the query string).  Also, 
based on those values, you will need to generate a page and make a way to 
move from one page to the next.  This is a tedious process, but it isn't 
difficult.  However, you don't necessarily need to reinvent the wheel.  If 
you incorporate a data model into your design, like Class::DBI, you can take 
advantage of some of their extension modules, like Class::DBI::Pager. 
Unfortunately, any solution here will require learning a fair amount about 
how your existing code works and how to generate CGI forms.  Again, none of 
this is hard, but I would suggest getting a CGI book if all of the above 
terminology (like hidden fields) sounds foreign.

Sean
- Original Message - 
From: "Literatecat" <[EMAIL PROTECTED]>
To: "Sean Davis" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, January 04, 2005 7:29 PM
Subject: Re: Database Rows Returned


Hi Sean,
The max_rows_returned is set in the setup file, but it simply determines 
the number of rows per page.  Then when it reads line by line that there 
are more than the predetermined maximum rows per page, it prints the 
warning that the number of rows have been exceeded, and suggests refining 
the search parameters.
In this case, could refining search parameters be as simple as setting a 
limit in the SQL query?

Problem is that I want to be able to pick up all the rows although not all 
on the same page, there must be some way of getting it to change to 
creating a new page with the next line read exceeding the max rows, and so 
on till the search parameter is filled.  Then placing the link to the next 
set of "25" for instance at the bottom of the page instead of suggested 
that the search be refined.
Unfortunately, CGI scripts cannot make decisions like "make a new page". 
Their only job is to generate ONE HTML page based on input from the request. 
At each page generation, you have to provide enough information on the page 
so that the next request (based on a submit button click, for example) 
allows the script to generate the next page when it runs again (eg., you 
have to tell the script what page number in a multiple-page output to 
generate; you can do this with form parameters).

You can see this in operation at 
http://www.etheria.com.au/cgi-bin/web_store.pl?


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Re: Database Rows Returned

2005-01-04 Thread Literatecat
Hi Sean,
The max_rows_returned is set in the setup file, but it simply determines the 
number of rows per page.  Then when it reads line by line that there are 
more than the predetermined maximum rows per page, it prints the warning 
that the number of rows have been exceeded, and suggests refining the search 
parameters.

Problem is that I want to be able to pick up all the rows although not all 
on the same page, there must be some way of getting it to change to creating 
a new page with the next line read exceeding the max rows, and so on till 
the search parameter is filled.  Then placing the link to the next set of 
"25" for instance at the bottom of the page instead of suggested that the 
search be refined.

You can see this in operation at 
http://www.etheria.com.au/cgi-bin/web_store.pl?

Just in case looking at it working helps.  I don't understand what happens 
to create the next couple of pages.

thanks in advance
cat
- Original Message - 
From: "Sean Davis" <[EMAIL PROTECTED]>
To: "Literatecat" <[EMAIL PROTECTED]>
Sent: Tuesday, January 04, 2005 9:47 PM
Subject: Re: Database Rows Returned


Cat,
For whatever reason, the original developer felt it necessary to place a 
limit on the number of rows.  It seems that the important variable 
governing that number is $sc_db_max_rows_returned.  You could simply set 
that to a larger number.  Will that do what you need?

Sean
On Jan 3, 2005, at 10:24 PM, Literatecat wrote:
Thanks for the prompt response Sean
Hopefully this will provide all that is needed.
 }
 ($status,$total_row_count) = &submit_query(*database_rows);
sub check_db_with_product_id {
 local($product_id, *db_row) = @_;
 local($db_product_id);
open(DATAFILE, "$sc_data_file_path") ||
   &file_open_error("$sc_data_file_path",
 "Read Database",__FILE__,__LINE__);
sub submit_query
{
 local(*database_rows) = @_;
 local($status);
 local(@fields);
 local($row_count);
 local(@not_found_criteria);
 local($line); # Read line from database
local($exact_match) = $form_data{'exact_match'};
 local($case_sensitive) = $form_data{'case_sensitive'};
while(($line =  ) &&
   ($row_count < $sc_db_max_rows_returned + 1))
 {
   chop($line); # Chop off extraneous newline
@fields = split(/\|/, $line);
$not_found = 0;
   foreach $criteria (@sc_db_query_criteria)
   {
 $not_found += &flatfile_apply_criteria(
$exact_match,
$case_sensitive,
*fields,
$criteria);
   }
if (($not_found == 0) &&
   ($row_count <= $sc_db_max_rows_returned))
   {
 push(@database_rows, join("\|", @fields));
   }
if ($not_found == 0) {
 $row_count++;
   }
 } # End of while datafile has data
if ($row_count > $sc_db_max_rows_returned) {
   $status = "max_rows_exceeded";
 }
return($status,$row_count);
} # End of submit query
I haven't included the Close (datafile) etc  Just the code pertaining to 
the query that I can find.  It is all in different files but mainly in 
one library.

Hope this helps.
thanks in advance
cat


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Re: Database Rows Returned

2005-01-03 Thread Sean Davis
Cat,
Unfortunately, you haven't given us the "business" end of your script. 
Unless you can tell us where $db_status and $total_rows_returned comes from, 
it is unlikely that we will be able to help much.

Sean
- Original Message - 
From: "Cat" <[EMAIL PROTECTED]>
To: 
Sent: Monday, January 03, 2005 7:50 PM
Subject: Database Rows Returned

Hi folks,
I am hoping that I can get some help here.
When I search my database it comes back with the max rows and then
prints a note to say that I need to refine my search.  Yep you guessed
it...someone elses script.
I don't understand the concept of what happens to create the code to
have it present the remaining rows in linked pages.  So I am asking for
a little help
local($db_status, $total_rows_returned) = @_;
 local($warn_message);
 $warn_message = "";
if ($db_status ne "")
   {
   if ($db_status =~ /max.*row.*exceed.*/i)
 {
 $warn_message = qq!
 
 
 Your query returned $total_rows_returned.  This is more than
 the maximum we allow ($sc_db_max_rows_returned). You will need to
 restrict your query further.
 !;
 }
   }
Hoping someone might be willing to assist.
Thanks in advance
Cat

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Database Rows Returned

2005-01-03 Thread Cat
Hi folks,

I am hoping that I can get some help here.

When I search my database it comes back with the max rows and then prints a 
note to say that I need to refine my search.  Yep you guessed it...someone 
elses script.

I don't understand the concept of what happens to create the code to have it 
present the remaining rows in linked pages.  So I am asking for a little 
help

 local($db_status, $total_rows_returned) = @_;
  local($warn_message);
  $warn_message = "";

 if ($db_status ne "") 
{
if ($db_status =~ /max.*row.*exceed.*/i) 
  {
  $warn_message = qq!
  
  
  Your query returned $total_rows_returned.  This is more than
  the maximum we allow ($sc_db_max_rows_returned). You will need to
  restrict your query further.
  !;
  }
}

Hoping someone might be willing to assist.

Thanks in advance

Cat

online database manager

2004-12-09 Thread planar
Does someone know convenient Perl online database with
alphabetical selector, allowing select the specific
letter use alphabeticall selector, without viewing all
list? No online editing required, just display. Plus 
search feature.

[A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] 
[N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z]






__ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Which interface should I be using for Database Access?

2004-09-01 Thread William McKee
On Wed, Sep 01, 2004 at 09:16:53AM -0600, Siegfried Heintze wrote:
> This is GREAT! But being a beginner, I don't know what to do next. Do I
> download the source? Is there a PPM module? Where can I find an example that
> accesses Microsoft Access?

Hi Siegfried,

I believe that there is a PPM for DBI and DBD::ODBC. Fire up ppm3 and
see for yourself. I have an old code sample (ergo, not the best form but
it works) which I will send to you offlist.


Good luck,
William

-- 
Knowmad Services Inc.
http://www.knowmad.com

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




RE: Which interface should I be using for Database Access?

2004-09-01 Thread Spindler, Brian
The benefit of DBD::ODBC is that you do not have to do "database
specific" querying so to speak.  You would setup an ODBC connection
(Control Panel->ODBC Administrator) to your Access database, then use
the DSN name you created to access the access database.  Do a `perldoc
DBD::ODBC` to get any documentation you may need on how to connect to
your DSN and manipulate the database.

-Brian 

-Original Message-
From: Siegfried Heintze [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 01, 2004 11:17 AM
To: [EMAIL PROTECTED]
Subject: Which interface should I be using for Database Access?

Wow! This is news to me! I've been using Win32::ODBC and was very
worried about portability. Now I try perldoc and cannot find anything
about using DBI with ODBC. However, I search CPAN and I find this:

"3.3 Is DBI supported under Windows 95 / NT platforms?
Finally, yes! Jeff Urlwin has been working diligently on building DBI
and DBD::ODBC under these platforms, and, with the advent of a stabler
perl and a port of MakeMaker, the project has come on by great leaps and
bounds.

The DBI and DBD::Oracle Win32 ports are now a standard part of DBI, so,
downloading DBI of version higher than 0.81 should work fine as should
using the most recent DBD::Oracle version."


This is GREAT! But being a beginner, I don't know what to do next. Do I
download the source? Is there a PPM module? Where can I find an example
that accesses Microsoft Access?

  Thanks,
  Siegfried

-Original Message-
From: Wiggins d Anconia [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 01, 2004 7:33 AM
To: Rearick, Kenneth N.; '[EMAIL PROTECTED]'
Subject: Re: ODBC

> 
> 
> 
> I have a CGI program in which I am trying to access a database. When I
run the code in active state feeding it the input from the form it runs
fine. When I try to run it as a cgi from IE using Apache web server the
data from the form comes in fine but it can not seem to attach to the
database.
> 
> Is there anyway to see the errors that the DBI:ODBC is generating when
the application is being run from the server? Any ideas why the ODBC
connect is failing?
>

You can use CGI::Carp and 'fatalsToBrowser' to have fatal messages
thrown to the browser, alternatively error messages are generally sent
to the Apache error log.  Check there for what they have to say. You
could also turn off DBI's automatic exceptions and catch them yourself,
but this is a fair amount more work (at least while prototyping).
 
> $dbh = DBI->connect("DBI:ODBC:$SERVER", $USER, $PASSWORD);
> 
> 

Sorry can't help with the connect issue, I suspect if you can find the
error output it will.  If not you might try the dbi-users group or maybe
someone else with ODBC experience will chime in.

http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



***
This e-mail and any files transmitted with it are confidential and are
intended solely for the use of the individual or entity to whom they are
addressed. The views, opinions, and information expressed in this message
represents those of the individual sender and do not reflect the views of
Ruesch International, Inc. Take notice that the employees and/or agents of
Ruesch International are not authorized to make corporate commitments or
representations via e-mail and no statement or representation made in this
e-mail is binding upon Ruesch International. Ruesch cannot guarantee the
integrity or the confidentiality of any incoming or outgoing e-mail
communication.
***


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Which interface should I be using for Database Access?

2004-09-01 Thread Siegfried Heintze
Wow! This is news to me! I've been using Win32::ODBC and was very worried
about portability. Now I try perldoc and cannot find anything about using
DBI with ODBC. However, I search CPAN and I find this:

"3.3 Is DBI supported under Windows 95 / NT platforms?
Finally, yes! Jeff Urlwin has been working diligently on building DBI and
DBD::ODBC under these platforms, and, with the advent of a stabler perl and
a port of MakeMaker, the project has come on by great leaps and bounds.

The DBI and DBD::Oracle Win32 ports are now a standard part of DBI, so,
downloading DBI of version higher than 0.81 should work fine as should using
the most recent DBD::Oracle version."


This is GREAT! But being a beginner, I don't know what to do next. Do I
download the source? Is there a PPM module? Where can I find an example that
accesses Microsoft Access?

  Thanks,
  Siegfried

-Original Message-
From: Wiggins d Anconia [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 01, 2004 7:33 AM
To: Rearick, Kenneth N.; '[EMAIL PROTECTED]'
Subject: Re: ODBC

> 
> 
> 
> I have a CGI program in which I am trying to access a database. When I
run the code in active state feeding it the input from the form it runs
fine. When I try to run it as a cgi from IE using Apache web server the
data from the form comes in fine but it can not seem to attach to the
database.
> 
> Is there anyway to see the errors that the DBI:ODBC is generating when
the application is being run from the server? Any ideas why the ODBC
connect is failing?
>

You can use CGI::Carp and 'fatalsToBrowser' to have fatal messages
thrown to the browser, alternatively error messages are generally sent
to the Apache error log.  Check there for what they have to say. You
could also turn off DBI's automatic exceptions and catch them yourself,
but this is a fair amount more work (at least while prototyping).
 
> $dbh = DBI->connect("DBI:ODBC:$SERVER", $USER, $PASSWORD);
> 
> 

Sorry can't help with the connect issue, I suspect if you can find the
error output it will.  If not you might try the dbi-users group or maybe
someone else with ODBC experience will chime in.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: How to secure database password? (was Re: Perl/DBI newbie: password storage / security question)

2003-11-27 Thread Todd Farmer
I've written a custom module (say "dbConnect.PM") where the password is
hard-coded and is a return value from a function (e.g., "get_password()").
This module is not located in a publicly-accessible folder (i.e., not in
htdocs or cgi-bin).  My scripts in the cgi-bin call this custom module's
function which returns the password, which the scripts then use to connect
to the database.

An additional security (and maintenance) benefit to this implementation is
that the password is stored in a single location, rather than peppered
throughout my scripts.  This makes regular updates of the database password
fast and simple.

I continue to ask the same questions you are asking, though.  If anybody has
better ideas or sees limitations with this solution, I'd love to hear.

Todd F.

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 17, 2003 12:04 AM
Subject: How to secure database password? (was Re: Perl/DBI newbie: password
storage / security question)


> Hello,
>
> Many thanks to R. Joseph Newton, Motherofperls, essential quint and Chuck
Fox for answering my questions, however it is still not what I was asking
about. My previous posts were long and maybe unclear so I'll try to get
straight to the point this time, adding more details at the bottom of my
post.
>
> It is actually an extremely common situation: There is a CGI script
written in Perl. It is a frontend to an SQL database.
>
> The script has to connect to the database so it has to send a password. I
need that password to be secure. I am not interested in security through
obscurity. There are other websites on the web server and other users on the
system.
>
> My solution was using SUID wrappers giving my script an EUID of a system
user having only one purpose: being the only member of the only group having
read privilage to a file storing the database password. The disadvantage of
this solution is the large number of system users and groups (few for every
website/database) and corresponding database accounts (with the minimum set
of privileges each).
>
> I am quite new to Perl and particularly new to database programming, so
I'd like to ask how all of you Perl gurus are solving that common problem of
database password security. Is there any better solution than mine?
>
> This problem is simple and common, but if there is any better place to ask
this questions, I'd be grateful for pointing me there.
>
> I have tried my best to find any related informations on the Web and
Usenet archives, only to fail miserably. I will not believe that any sane
person has passwords harcoded into the script itself on any production
system, like it is suggested in every example of using DBI (which, as I
assume, is done only for the sake of the examples simplicity).
>
> For more datails of my original questions and reasoning see:
>
> Date: Sat, 13 Sep 2003 05:09:58 -0500 (EST)
> Message-Id: <[EMAIL PROTECTED]>
> http://www.mail-archive.com/beginners%40perl.org/msg46845.html
>
> Date: Sat, 13 Sep 2003 21:25:55 -0500 (EST)
> Message-Id: <[EMAIL PROTECTED]>
> http://www.mail-archive.com/beginners%40perl.org/msg46856.html
>
> I was trying to be very clear this time, moving the most important
informations to the top of my message, so everyone could know what I mean
before getting lost in the details of my own reasoning. And now some
details:
>
> Joseph, I was asking about database password, not password database, but
speaking about the latter, I would never use a self-made custom hashing
algorithm you suggested, nor would I buy any third-party RSA encryption
application for that matter.[1] Also, this is not true that the hashing
algorithm is any more secure as a compiled object.[2]
>
> Quint, I was not wondering whether to use RDBMS or flat files, but there
are ways to make working with flat files equally convenient.[3] Of course I
use HTTPS for client connections, so the users' passwords are safe in
transit.[1] I use CPAN modules for everything I can and I make sure my own
scripts themselves are written with security in mind.[4]
>
> Quint, you say that the argument againts flat files is that they have to
be writable by the httpd process EUID, but then you propose embedding the
RDBMS password in the script or module instead (readable by the server
process), which essentially makes the whole database world-writable (as
anyone with read access to the script or module, like everyone exploiting
any other CGI script on the system, can gain full access to the database),
which is absolutely unacceptable for any multiuser system connected to the
Internet.
>
> Chuck, your solutions of stor

Re: How to secure database password? (was Re: Perl/DBI newbie: password storage / security question)

2003-09-17 Thread Chuck Fox
Zedgar,

You are chasing the yourself into circles.  Security is dictated by 
circumstances and resources available.  In our case, we had plenty of 
both and developed for our needs the "best" solution.  Insofar as the 
storing of the password for the login that is used to get the password, 
we took the approach of encrypting the passwords prior to inserting them 
in our password server and using the guest login to get the passwords 
(no password on guest).  So a user could login to our password server as 
guest and get the passwords for a server, however the data is encrypted 
and would require our decryption module to make sense of it.

Again, the point is that, "secure" has to be defined for your particular 
circumstances.  If it makes more sense for you to use the OS to protect 
passwords, then that is your "best" solution.

Good Luck,

Chuck

[EMAIL PROTECTED] wrote:

Hello,

Many thanks to R. Joseph Newton, Motherofperls, essential quint and Chuck Fox for answering my questions, however it is still not what I was asking about. My previous posts were long and maybe unclear so I'll try to get straight to the point this time, adding more details at the bottom of my post.

It is actually an extremely common situation: There is a CGI script written in Perl. It is a frontend to an SQL database.

The script has to connect to the database so it has to send a password. I need that password to be secure. I am not interested in security through obscurity. There are other websites on the web server and other users on the system.

My solution was using SUID wrappers giving my script an EUID of a system user having only one purpose: being the only member of the only group having read privilage to a file storing the database password. The disadvantage of this solution is the large number of system users and groups (few for every website/database) and corresponding database accounts (with the minimum set of privileges each).

I am quite new to Perl and particularly new to database programming, so I'd like to ask how all of you Perl gurus are solving that common problem of database password security. Is there any better solution than mine?

This problem is simple and common, but if there is any better place to ask this questions, I'd be grateful for pointing me there.

I have tried my best to find any related informations on the Web and Usenet archives, only to fail miserably. I will not believe that any sane person has passwords harcoded into the script itself on any production system, like it is suggested in every example of using DBI (which, as I assume, is done only for the sake of the examples simplicity).

For more datails of my original questions and reasoning see:

Date: Sat, 13 Sep 2003 05:09:58 -0500 (EST)
Message-Id: <[EMAIL PROTECTED]>
http://www.mail-archive.com/beginners%40perl.org/msg46845.html
Date: Sat, 13 Sep 2003 21:25:55 -0500 (EST)
Message-Id: <[EMAIL PROTECTED]>
http://www.mail-archive.com/beginners%40perl.org/msg46856.html
I was trying to be very clear this time, moving the most important informations to the top of my message, so everyone could know what I mean before getting lost in the details of my own reasoning. And now some details:

Joseph, I was asking about database password, not password database, but speaking about the latter, I would never use a self-made custom hashing algorithm you suggested, nor would I buy any third-party RSA encryption application for that matter.[1] Also, this is not true that the hashing algorithm is any more secure as a compiled object.[2]

Quint, I was not wondering whether to use RDBMS or flat files, but there are ways to make working with flat files equally convenient.[3] Of course I use HTTPS for client connections, so the users' passwords are safe in transit.[1] I use CPAN modules for everything I can and I make sure my own scripts themselves are written with security in mind.[4]

Quint, you say that the argument againts flat files is that they have to be writable by the httpd process EUID, but then you propose embedding the RDBMS password in the script or module instead (readable by the server process), which essentially makes the whole database world-writable (as anyone with read access to the script or module, like everyone exploiting any other CGI script on the system, can gain full access to the database), which is absolutely unacceptable for any multiuser system connected to the Internet.

Chuck, your solutions of storing the password in another database,[5] or moving the password outside the script[6] don't solve the problem, but only move it to someplace else, where it is still unsolved, not improving the security at all.

Zedgar.

Footnotes:

[1] About the security of users' passwords: See Digest::* modules on CPAN for hashing digests. I use Data::Password::BasicCheck, Data::Password and Crypt::Cracklib (in that order) with good dictionaries to make sure the user'

How to secure database password? (was Re: Perl/DBI newbie: password storage / security question)

2003-09-17 Thread zedgar
Hello,

Many thanks to R. Joseph Newton, Motherofperls, essential quint and Chuck Fox for 
answering my questions, however it is still not what I was asking about. My previous 
posts were long and maybe unclear so I'll try to get straight to the point this time, 
adding more details at the bottom of my post.

It is actually an extremely common situation: There is a CGI script written in Perl. 
It is a frontend to an SQL database.

The script has to connect to the database so it has to send a password. I need that 
password to be secure. I am not interested in security through obscurity. There are 
other websites on the web server and other users on the system.

My solution was using SUID wrappers giving my script an EUID of a system user having 
only one purpose: being the only member of the only group having read privilage to a 
file storing the database password. The disadvantage of this solution is the large 
number of system users and groups (few for every website/database) and corresponding 
database accounts (with the minimum set of privileges each).

I am quite new to Perl and particularly new to database programming, so I'd like to 
ask how all of you Perl gurus are solving that common problem of database password 
security. Is there any better solution than mine?

This problem is simple and common, but if there is any better place to ask this 
questions, I'd be grateful for pointing me there.

I have tried my best to find any related informations on the Web and Usenet archives, 
only to fail miserably. I will not believe that any sane person has passwords harcoded 
into the script itself on any production system, like it is suggested in every example 
of using DBI (which, as I assume, is done only for the sake of the examples 
simplicity).

For more datails of my original questions and reasoning see:

Date: Sat, 13 Sep 2003 05:09:58 -0500 (EST)
Message-Id: <[EMAIL PROTECTED]>
http://www.mail-archive.com/beginners%40perl.org/msg46845.html

Date: Sat, 13 Sep 2003 21:25:55 -0500 (EST)
Message-Id: <[EMAIL PROTECTED]>
http://www.mail-archive.com/beginners%40perl.org/msg46856.html

I was trying to be very clear this time, moving the most important informations to the 
top of my message, so everyone could know what I mean before getting lost in the 
details of my own reasoning. And now some details:

Joseph, I was asking about database password, not password database, but speaking 
about the latter, I would never use a self-made custom hashing algorithm you 
suggested, nor would I buy any third-party RSA encryption application for that 
matter.[1] Also, this is not true that the hashing algorithm is any more secure as a 
compiled object.[2]

Quint, I was not wondering whether to use RDBMS or flat files, but there are ways to 
make working with flat files equally convenient.[3] Of course I use HTTPS for client 
connections, so the users' passwords are safe in transit.[1] I use CPAN modules for 
everything I can and I make sure my own scripts themselves are written with security 
in mind.[4]

Quint, you say that the argument againts flat files is that they have to be writable 
by the httpd process EUID, but then you propose embedding the RDBMS password in the 
script or module instead (readable by the server process), which essentially makes the 
whole database world-writable (as anyone with read access to the script or module, 
like everyone exploiting any other CGI script on the system, can gain full access to 
the database), which is absolutely unacceptable for any multiuser system connected to 
the Internet.

Chuck, your solutions of storing the password in another database,[5] or moving the 
password outside the script[6] don't solve the problem, but only move it to someplace 
else, where it is still unsolved, not improving the security at all.

Zedgar.

Footnotes:

[1] About the security of users' passwords: See Digest::* modules on CPAN for hashing 
digests. I use Data::Password::BasicCheck, Data::Password and Crypt::Cracklib (in that 
order) with good dictionaries to make sure the user's new password itself is secure 
enough (to users having problems with hard-to-guess passwords I recommend Password 
Safe, either the original Bruce Schneier's Counterpane Labs version, or the new one 
available on SourceForge). The password is stored in the database as a SHA-512 digest 
of the password salted with other data, as well as a large random number also stored 
in the database (Crypt::Random).

[2] Having the hashing algorithm compiled to a native binary object improves 
performance, but not security (for an example see Digest::Perl::MD5 and Digest::MD5).

[3] See DBD::CSV and DBD::AnyData modules for DBI interface to flat files with simple 
SQL queries (processed by SQL::Statement). It's great for quick prototyping, but 
quickly gets slow for larger files. What I personally prefer for prototyping and for 
any situation when there's no acc

any file system in database with gnu gpl license ?

2003-08-25 Thread german aracil boned
Yes .. I build a file system with firebird, perl and others.
It's a free open source project.
For more information visit the web project at 
http://sourceforge.net/projects/tlsystem

I'm waiting yours comments.

best regards

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


Re: want to verify the data coming from a form with the data in database

2003-06-11 Thread Greg Jetter
On Wednesday June 11 2003 10:09 am, Greenhalgh David wrote:
> On Wednesday, June 11, 2003, at 02:10  am, Annie wrote:
> > no i want to ask what if someone enters a firstname and last name
> > which doesnot exist in the database...in that case how i can verify
> > and print an error msg that the data doesnot exist for this first name
> > and last name.
>
> Well a fairly simple way would be to check to see if there is a return
> from the query...
>
> > use strict;
> > use DBI;
> > .
> > .
> > .
> > my $dbhandle=DBI->connect("DBI:mysql:data_base_name", "username",
> > "password");
> > my $query = "SELECT * FROM table_name WHERE lastname = '$a2' AND
> > firstname = '$a1'";
> > my $statementhandle = $dbhandle->prepare($query);
> > $statementhandle->execute;
>
> my @return
>
> > while (($lastname, $firstname, $age, $address) =
> > $statmenthandle->fetchrow()){
>
> @return = ($lastname, $firstname, $age, $address)
>
> > }
>
> if ([EMAIL PROTECTED]){
>
> PRINT ERROR MESSAGE HERE
> }
> else {
>
> PRINT DATABASE DATA HERE
> }


along the same lines , the dbi  method  rows

 $statementhandle->execute;

my $results =  $statementhandle->rows;

if( $results <= 0 )  { do an error message} else { print " you're in the 
database";}


Greg




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



Re: want to verify the data coming from a form with the data in database

2003-06-11 Thread Greenhalgh David
On Wednesday, June 11, 2003, at 02:10  am, Annie wrote:

no i want to ask what if someone enters a firstname and last name 
which doesnot exist in the database...in that case how i can verify 
and print an error msg that the data doesnot exist for this first name 
and last name.

Well a fairly simple way would be to check to see if there is a return 
from the query...

use strict;
use DBI;
.
.
.
my $dbhandle=DBI->connect("DBI:mysql:data_base_name", "username",
"password");
my $query = "SELECT * FROM table_name WHERE lastname = '$a2' AND
firstname = '$a1'";
my $statementhandle = $dbhandle->prepare($query);
$statementhandle->execute;
my @return

while (($lastname, $firstname, $age, $address) =
$statmenthandle->fetchrow()){
@return = ($lastname, $firstname, $age, $address)
}


if ([EMAIL PROTECTED]){

PRINT ERROR MESSAGE HERE
}
else {
PRINT DATABASE DATA HERE
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: want to verify the data coming from a form with the data in database

2003-06-10 Thread Annie
no i want to ask what if someone enters a firstname and last name which doesnot exist 
in the database...in that case how i can verify and print an error msg that the data 
doesnot exist for this first name and last name.

Greenhalgh David <[EMAIL PROTECTED]> wrote:Am I understanding you correctly? Your form 
only has two fields, 
lastname and firstname?

In that case SELECT * FROM table_name WHERE lastname = '$a2' AND 
firstname = '$a1'

works on the command line. (Wasn't sure if you could use the AND like 
that, but it seems you can) so all you need to do is perlify it with 
something like

use strict;
use DBI;
.
.
.
my $dbhandle=DBI->connect("DBI:mysql:data_base_name", "username", 
"password");
my $query = "SELECT * FROM table_name WHERE lastname = '$a2' AND 
firstname = '$a1'";
my $statementhandle = $dbhandle->prepare($query);
$statementhandle->execute;

while (($lastname, $firstname, $age, $address) = 
$statmenthandle->fetchrow()){
print ;
}

Without forgetting all the die statements!

HTH

Dave


On Tuesday, June 10, 2003, at 07:40 am, Annie wrote:

> i have a perl file which is receiving the data from a form...and i 
> want to verify the two fields $a2 and $a1 i m receiving from form to 
> be checked in a table in database( using mysql)...and then if the data 
> is verified in any of the row of the tablethe corresponding whole 
> row data should be fetched.
> like if the table has columns
> lastname firstname age address
> person1 name1 23 add1
> person2 name2 34 add2
> person3.and so on...
> and if $a2='person1' and $a1='name1' then i want to fetch 23 and add1.
>
>
>
> -
> Do you Yahoo!?
> Free online calendar with sync to Outlook(TM).


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



-
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

Re: want to verify the data coming from a form with the data in database

2003-06-10 Thread Greenhalgh David
Am I understanding you correctly? Your form only has two fields, 
lastname and firstname?

In that case SELECT * FROM table_name WHERE lastname = '$a2' AND 
firstname = '$a1'

works on the command line. (Wasn't sure if you could use the AND like 
that, but it seems you can) so all you need to do is perlify it with 
something like

use strict;
use DBI;
.
.
.
my $dbhandle=DBI->connect("DBI:mysql:data_base_name", "username", 
"password");
my $query = "SELECT * FROM table_name WHERE lastname = '$a2' AND 
firstname = '$a1'";
my $statementhandle = $dbhandle->prepare($query);
$statementhandle->execute;

while (($lastname, $firstname, $age, $address) = 
$statmenthandle->fetchrow()){
print ;
}

Without forgetting all the die statements!

HTH

Dave

On Tuesday, June 10, 2003, at 07:40  am, Annie wrote:

i have a perl file which is receiving the data from a form...and i 
want to verify the two fields $a2 and $a1 i m receiving from form to 
be checked in a table in database( using mysql)...and then if the data 
is verified in any of the row of the tablethe corresponding whole 
row data should be fetched.
like if the table has columns
lastname   firstname  age   address
person1 name1  23   add1
person2 name2  34  add2
person3.and so on...
and if $a2='person1' and $a1='name1' then i want to fetch 23 and add1.



-
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).


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


want to verify the data coming from a form with the data in database

2003-06-09 Thread Annie
i have a perl file which is receiving the data from a form...and i want to verify the 
two fields $a2 and $a1 i m receiving from form to be checked in a table in database( 
using mysql)...and then if the data is verified in any of the row of the tablethe 
corresponding whole row data should be fetched.
like if the table has columns
lastname   firstname  age   address
person1 name1  23   add1
person2 name2  34  add2
person3.and so on...
and if $a2='person1' and $a1='name1' then i want to fetch 23 and add1.
 


-
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

Re: connectivity b/w a form in html and database using perl

2003-06-02 Thread Sven Bentlage
Hi Annie!

This code ain`t pretty, but it works 
(BTW, has been made possible only by the help of this mailing list, 
thanks again to everyone..)

Cheers,
Sven
if ($action eq ''){
  apply();
 }
  elsif ($action eq "apply"){
my $count = find();
if ($count == 0) {
  error();
  exit;
}
  else {
get_pw();
  }
}
# creates HTML from
sub apply {
  # form w/ hidden field below
  #
  #
}
# Checks if user exists in database
sub find {
  my $dbh = DBI->connect($dsn, $db_user, $db_pass );
  my $name = $q->param("f_name");
  my $surname = $q->param("f_surname");
  if ($surname =~ m/'/g) { ($surname) = grep s/'/\\'/g, $surname };
  my $sth =  $dbh->prepare(
 "select count(*)
 from .. where name = '$f_name' and surname = '$f_surname'" ) or 
mydie($DBI::errstr);
  $sth->execute();
  my ( $count ) = $sth->fetchrow_array();
  $sth->finish;
  $dbh->disconnect;
  return $count;
}
# retrieves password from db
sub get_pw {
  my $f_name = param('f_name');
  my $f_surname = param('f_surname');
  if ($f_surname =~ m/'/g) { ($f_surname) = grep s/'/\\'/g, $f_surname 
};
  if ( ( $f_name ne '' ) and ( $f_surname ne '') ) {
chomp $f_name; chomp $f_surname;
my $dbh = DBI->connect( $dsn, $db_user, $db_pass ) || 
mydie($DBI::errstr);
my $sth = $dbh->prepare( "[select something] " );
$sth->execute() ;
}



On Sunday, June 1, 2003, at 10:39 PM, Annie wrote:

I have a form with two textfields ..one for login and one for password 
and two buttons reset and submit. on submit i need to verify the login 
and password from a table in mysql and want to retrieve the 
corresponding information of the verified id and password.
right now my perl code is able to retrieve all the fields of the 
table. i need to do the above...can anyone guide me.

-
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).


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


Re: connectivity b/w a form in html and database using perl

2003-06-02 Thread WC -Sx- Jones
On Sunday, June 1, 2003, at 04:39  PM, Annie wrote:

I have a form with two textfields ..one for login and one for password  
and two buttons reset and submit. on submit i need to verify the login  
and password from a table in mysql and want to retrieve the  
corresponding information of the verified id and password.
right now my perl code is able to retrieve all the fields of the  
table. i need to do the above...can anyone guide me.

Here is some examples of getting data off the web and vice versa -

(NOTE - you may need to fix line wrapping issues caused by mailing.)

#!/usr/bin/perl -w
# Author: Daniel Stringfield ([EMAIL PROTECTED])
# Purpose: Web interface/database for Mentoring Skills list
#
# NEW Purpose: Web interface/database Test Bed for MySQL...
use DBD::mysql;
use CGI qw(:all);
use Socket;
my $query = new CGI;
$| = 1;
my $mentorcgi = "http://www.fccj.org/cgi/mentors.pl";;
my $dbid = "someID";
my $dbpass = "somePW";
my $db = "mentor";
my $dbhost = "www.fccj.org";
my $dbh = DBI->connect("DBI:mysql:$db:$dbhost",$dbid,$dbpass);
print header;
#open(FCCJH, "/usr/lib/cgi/fccjheader");
#while () {
#print $_ ; }
if (!param('cmd')) {
    print "Welcome to the Faculty Mentoring Skills  
List";
    print "You may http://www.fccj.org/cgi/mentors.pl?cmd=list\";>List All Faculty  
Mentors or http://www.fccj.org/cgi/mentors.pl?cmd=search\";>Search By  
Skill";

    }

if (param('cmd') eq "search") {
    print "";
    print "Skill to search for:";
    print "";
    print "";
    print "";
    }

if (param('cmd') eq "dosearch") {
    my $skill = param('skill');
    my $statement = "select uid,skill,si from skills where skill  
like \"%$skill%\"";
    my $sth = $dbh->prepare($statement)
        || die "Can not prepare $statement: $!";
    my $rc = $sth->execute
        || die "Can not execute $statement: $!";
    my @row = $sth->fetchrow_array;
    print "";
    print  
"NameSkillEmailPhone";
    while(@row) {
        my $statement = "select name,email,phone from mentors  
where uid=\"$row[0]\"";
        my $namesth = $dbh->prepare($statement)
            || die "Can not prepare $statement: $!";
        my $rc = $namesth->execute
            || die "Can not execute $statement: $!";
        my @name = $namesth->fetchrow_array;
        print "$name[0]$row[1]mailto:$name[1]\";>$name[1]$name[2]";

        @row = $sth->fetchrow_array;
        }
    print "";
    }
if (param('cmd') eq "list") { listmentors(); }

if (param('cmd') eq "show") { showmentor(); }

if (param('cmd') eq "delskill") {
    my $si = param('si');
    my $statement = "select skill,uid from skills where si=\"$si\"";
    my $sth = $dbh->prepare($statement)
        || die "Can't prepare $statement: $!";
    my $rc = $sth->execute
        || die "Can not do $statement: $!";
    my @skill = $sth->fetchrow_array;
    my $rv = $sth->finish;
    my $uid = $skill[1];
    $statement = "select name from mentors where uid=\"$uid\"";
    $sth = $dbh->prepare($statement)
        || die "Can not prepare $statement: $!";
    $rc = $sth->execute
        || die "Can not do $statement: $!";
    my @row = $sth->fetchrow_array;
    $rv = $sth->finish;
    print "";
    print "Delete skill for  
$row[0]$skill[0]";
    print "PROFS ID:PROFS Password:";

    print "";

    print "";
    print "";
    }

if (param('cmd') eq "editskill") {
    my $si = param('si');
    my $statement = "select skill,uid from skills where si=\"$si\"";
    my $sth = $dbh->prepare($statement)
        || die "Can't prepare $statement: $!";
    my $rc = $sth->execute
        || die "Can not do $statement: $!";
    my @skill = $sth->fetchrow_array;
    my $rv = $sth->finish;
    my $uid = $skill[1];
    $statement = "select name from mentors where uid=\"$uid\"";
    $sth = $dbh->prepare($statement)
        || die "Can not prepare $statement: $!";
    $rc = $sth->execute
        || die "Can not do $statement: $

connectivity b/w a form in html and database using perl

2003-06-02 Thread Annie
I have a form with two textfields ..one for login and one for password and two buttons 
reset and submit. on submit i need to verify the login and password from a table in 
mysql and want to retrieve the corresponding information of the verified id and 
password.
right now my perl code is able to retrieve all the fields of the table. i need to do 
the above...can anyone guide me.


-
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

need help in desinging login page and connecting it with database

2003-06-01 Thread Annie
1. Need to send the userid and password from the login form to the "emprec " table in 
database and verify id and password. (id is first name and passwd is lastname).
2.After verification of the userid & password, the other fields record should be 
retrieved and displayed as a webpage.
 
can anyone tell me how i can do this? here is my perl code ..which is right now 
retrieving all the contents of the table in database without verifying user id and 
passwd.
 
#!/usr/bin/perl
#install me in public_html/cgi-bin with permissions drwxr-xr-x emprec.pl
use strict;
use warnings;
use DBI;
use DBD::mysql;
use CGI;
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
my $q=new CGI;
print $q->header;
warningsToBrowser(1);
print $q->start_html(-title=>'Employee Record',-bgcolor=>'#191970'),$q->h3('getting 
data from database');
my($lname,$fname,$age,$post,$ID,$address,$city,$state,$zip,$phno,$monthlysalary);
print $q->start_table(),
$q->Tr([$q->th({-align=>"LEFT",-bgcolor=>"#4682B4"},['lname','fname','age','post','ID','address','city','state','zip','phno','monthlysalary'])]);
my $dbh=DBI->connect("DBI:mysql:database=dbname","userid","passwd") or 
print"$DBI::errstr";
my $sth=$dbh->prepare("select * from emprec;");
$sth->execute();
$sth->bind_columns(\$lname,\$fname,\$age,\$post,\$ID,\$address,\$city,\$state,\$zip,\$phno,\$monthlysalary);
while($sth->fetch){print 
$q->Tr({-valign=>"TOP",-bgcolor=>"#ADD8E6"},[$q->td([$lname,$fname,$age,$post,$ID,$address,$city,$state,$zip,$phno,$monthlysalary])]);}
print $q->end_table(), $q->p("Back to". 
$q->a({-href=>"http://default.asp"},"homepage";)), $q->h4("Have A Good Day!!"), 
$q->end_html();
$dbh->disconnect;

 
 


-
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

RE: Database connection trouble

2003-02-21 Thread Bob Showalter
Bob Showalter wrote:
>   my $dsn = "DBI:$driver:database=$database;host=$hostname';

Oy vey! One more try:

my $dsn = "DBI:$driver:database=$database;host=$hostname";

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




RE: Database connection trouble

2003-02-21 Thread Bob Showalter
Van Andel, Robbert wrote:
> A coworker and I have been working on connecting to a MySQL database
> running on the webserver.  We are using the following command to
> connect: 
> 
> my $dsn = 'DBI:$driver:database=$database;host=$hostname';

  my $dsn = "DBI:$driver:database=$database;host=$hostname';

> my $dbh = DBI=>connect("$dsn", "$user", "$password") or die errstr

  my $dbh = DBI->connect($dsn, $user, $password) or die $DBI::errstr;

> 
> This works when run from an ordinary shell based perl program but when
> we try to put it on the website into the cgi-bin it will not connect.
> What are we doing wrong? 

Does MySQL need one or more environment variables set? If it connects via a
UNIX domain socket, is that socket writeable by the web server user? These
are just guesses; the $DBI::errstr should give you more info on the specific
problem.

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




RE: Database connection trouble

2003-02-21 Thread Van Andel, Robbert
We're not getting any error messages.  I'll have my coworker add the
$DBI->errstr in the die statement to see if that will help.  Thanks,

Robbert van Andel 


-Original Message-
From: Brent Michalski [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 21, 2003 10:31 AM
To: Van Andel, Robbert
Cc: [EMAIL PROTECTED]
Subject: RE: Database connection trouble



what error(s) are you getting?  Make sure you die with $DBI->errstr to
see
what is happening.  It could be any number of things at this point.
Have
you tried hard-coding the information in just to make sure it works that
way?  Then try with variables.

Brent





 

  "Van Andel,

  Robbert" To:   "Brent
Michalski" <[EMAIL PROTECTED]>
  

      rcom.com>Subject:  RE: Database
connection trouble   
 

  02/21/2003 11:12

  AM

 

 





I believe we've tried that as well.  We've tried single quotes, no
quotes and double quotes.  Non seem to work.

Robbert van Andel



-Original Message-
From: Brent Michalski [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 21, 2003 9:10 AM
To: Van Andel, Robbert
Cc: [EMAIL PROTECTED]
Subject: Re: Database connection trouble



I am guessing you want to do this instead:

my $dsn = "DBI:$driver:database=$database;host=$hostname";

By using the single quote, Perl will not interpolate the variable
names...


Brent







  "Van Andel,

  Robbert"     To:
<[EMAIL PROTECTED]>

  Subject:  Database
connection trouble


  02/21/2003 11:01

  AM









A coworker and I have been working on connecting to a MySQL database
running on the webserver.  We are using the following command to
connect:

my $dsn = 'DBI:$driver:database=$database;host=$hostname';
my $dbh = DBI=>connect("$dsn", "$user", "$password") or die errstr

This works when run from an ordinary shell based perl program but when
we try to put it on the website into the cgi-bin it will not connect.
What are we doing wrong?

Robbert van Andel


--
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: Database connection trouble

2003-02-21 Thread Brent Michalski

what error(s) are you getting?  Make sure you die with $DBI->errstr to see
what is happening.  It could be any number of things at this point.  Have
you tried hard-coding the information in just to make sure it works that
way?  Then try with variables.

Brent





   

  "Van Andel,  

  Robbert" To:   "Brent Michalski" 
<[EMAIL PROTECTED]>


  rcom.com>    Subject:  RE: Database connection 
trouble   
   

  02/21/2003 11:12 

  AM   

   

   





I believe we've tried that as well.  We've tried single quotes, no
quotes and double quotes.  Non seem to work.

Robbert van Andel



-Original Message-
From: Brent Michalski [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 21, 2003 9:10 AM
To: Van Andel, Robbert
Cc: [EMAIL PROTECTED]
Subject: Re: Database connection trouble



I am guessing you want to do this instead:

my $dsn = "DBI:$driver:database=$database;host=$hostname";

By using the single quote, Perl will not interpolate the variable
names...


Brent







  "Van Andel,

  Robbert" To:
<[EMAIL PROTECTED]>

  Subject:  Database
connection trouble


  02/21/2003 11:01

  AM









A coworker and I have been working on connecting to a MySQL database
running on the webserver.  We are using the following command to
connect:

my $dsn = 'DBI:$driver:database=$database;host=$hostname';
my $dbh = DBI=>connect("$dsn", "$user", "$password") or die errstr

This works when run from an ordinary shell based perl program but when
we try to put it on the website into the cgi-bin it will not connect.
What are we doing wrong?

Robbert van Andel


--
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: Database connection trouble

2003-02-21 Thread Van Andel, Robbert
I believe we've tried that as well.  We've tried single quotes, no
quotes and double quotes.  Non seem to work.

Robbert van Andel 



-Original Message-
From: Brent Michalski [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 21, 2003 9:10 AM
To: Van Andel, Robbert
Cc: [EMAIL PROTECTED]
Subject: Re: Database connection trouble



I am guessing you want to do this instead:

my $dsn = "DBI:$driver:database=$database;host=$hostname";

By using the single quote, Perl will not interpolate the variable
names...


Brent





 

  "Van Andel,

  Robbert" To:
<[EMAIL PROTECTED]>

  Subject:  Database
connection trouble   
 

  02/21/2003 11:01

  AM

 

 





A coworker and I have been working on connecting to a MySQL database
running on the webserver.  We are using the following command to
connect:

my $dsn = 'DBI:$driver:database=$database;host=$hostname';
my $dbh = DBI=>connect("$dsn", "$user", "$password") or die errstr

This works when run from an ordinary shell based perl program but when
we try to put it on the website into the cgi-bin it will not connect.
What are we doing wrong?

Robbert van Andel


--
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: Database connection trouble

2003-02-21 Thread Brent Michalski

I am guessing you want to do this instead:

my $dsn = "DBI:$driver:database=$database;host=$hostname";

By using the single quote, Perl will not interpolate the variable names...


Brent





   

  "Van Andel,  

  Robbert" To:   <[EMAIL PROTECTED]>  

  Subject:  Database connection trouble   

   

  02/21/2003 11:01 

  AM   

   

   





A coworker and I have been working on connecting to a MySQL database
running on the webserver.  We are using the following command to
connect:

my $dsn = 'DBI:$driver:database=$database;host=$hostname';
my $dbh = DBI=>connect("$dsn", "$user", "$password") or die errstr

This works when run from an ordinary shell based perl program but when
we try to put it on the website into the cgi-bin it will not connect.
What are we doing wrong?

Robbert van Andel


--
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]




Database connection trouble

2003-02-21 Thread Van Andel, Robbert
A coworker and I have been working on connecting to a MySQL database
running on the webserver.  We are using the following command to
connect:
 
my $dsn = 'DBI:$driver:database=$database;host=$hostname';
my $dbh = DBI=>connect("$dsn", "$user", "$password") or die errstr
 
This works when run from an ordinary shell based perl program but when
we try to put it on the website into the cgi-bin it will not connect.
What are we doing wrong?

Robbert van Andel 


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




Re: pop-up window with database access

2003-01-27 Thread Todd Wade

"Zentara" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Mon, 30 Sep 2002 11:47:37 -0500, [EMAIL PROTECTED] (Scot Robnett)
> wrote:
>
> >Define "a lot of people."
>
> I just did a quick google search for javascript statistics, and most
> of the surveys show somewhere between 10% and 15 % of people
> have disabled javascript.
>
> >I guess it depends how important the pop-up function is to the project.
Perl
> >and MySQL are quite capable of handling the back end, but they're not
going
> >to manage this function.
>
> Well you can design your page to not need javascript. Like use frames,
> with a small frame for you to display your "pop-up data" in, keep some
> nice logo in there otherwise. Or  you can always just pop open a new
> browser windowit isn't as cute and a tiny window, but it will always
> work.
>
You cant always design your page to not need javascript. I am working on an
app that inside one frame fetches a url which returns raw xml or extracts
raw xml out of a document using microsofts  tag. Sometimes the xml is
transformed by an XSLT stylesheet, sometimes it is traversed via the DOM.
Other times the display css property of elements are changed, or they are
"moved" by removeChild() and appendChild() so they are displayed differently
in the browser window.

When forms are submitted, rather than sending CGI parameters, some
javascript extracts the form's input field names and values and formats them
in xml. The javascript then submits the xml document to an apache mod_perl
server that has some web services exposed.




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




[OT] RE: Search database problem.

2003-01-18 Thread fliptop
On Sat, 18 Jan 2003 at 17:45, Hughes, Andrew opined:

[reply cc'd to list]

HA:DBD::mysql::db do failed: Duplicate entry '[EMAIL PROTECTED]' for
HA:key 2 at nCSSW.pl line 787.
HA:
HA:I know that you tried to point me in the right direction with the code
HA:snippet that you suggested.  However, as I am relatively new to all this, I
HA:cannot seem to make use of the error and perform decisions in the script
HA:based on it.

[snip]

HA:Can anyone offer any suggestions on where I can find info on how to retreive
HA:a database error message and make decisions on it in this context?

wrap your execute() inside an eval, then examine $@.  see below:

HA:eval {
HA:  $sth->execute('[EMAIL PROTECTED]');
HA:};
HA:
HA:if ($@) {
HA:  warn "error - probably a violation of the unique constraint";
HA:  # return something to the user
HA:}
HA:else {
HA:  $dbh->commit;
HA:}

btw, this subject is off-topic for this list.  if you are still having
problems, you probably should post your questions to a more appropriate
list.  perhaps perusing http://dbi.perl.org/ will yield a better forum for
your questions.


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




Re: Search database problem.

2003-01-17 Thread fliptop
On Fri, 17 Jan 2003 at 17:10, Hughes, Andrew opined:

[snip]
HA:The goal is that before I submit a form submission to the database, I want
HA:to make sure that someone with the same email address has not already
HA:submitted it.  If the count(*) brings up anything greater than 0 then the
HA:users has already submitted an entry and receives the "Duplicate Entry"
[snip]

why don't you put a unique index on the email field?  that will prevent 
duplicate records and save you a lot of overhead using perl to check for 
uniqueness.

then, when you go to insert a new record, wrap it in an eval {}.  if $@ 
contains something after the insert attempt, it's probably because the 
unique index constraint was violated.

for example:

my $sth = $dbh->prepare('insert into (foo) values(?)');

eval {
  $sth->execute('[EMAIL PROTECTED]');
};

if ($@) {
  warn "error - probably a violation of the unique constraint";
  # return something to the user
}
else {
  $dbh->commit;
}


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




Search database problem.

2003-01-17 Thread Hughes, Andrew
When I try to execute the chunck of code (at the bottom of this page) from a
script in the browser, I receive the following error

Cannot execute:  at nationalConsumerShoppingSurvey.pl line 129.

I have isolated to something having to do with this piece of the code:

'$participantEmail'

When I replace $participantEmail with an actual email address that is in the
database in the participantEmail field the script prints the "Duplicate
Entry" message as it should.  The catch is that I have to write the address
as 'test\@test.com'.

If I change it to an address that is not in the database, I receive the same
error message as I did the first time:

Cannot execute:  at nationalConsumerShoppingSurvey.pl line 129.

I have stripped all of the leading and trailing white spaces and validated
the email address before it gets to this code block.  Does anyone have any
suggestions?

The goal is that before I submit a form submission to the database, I want
to make sure that someone with the same email address has not already
submitted it.  If the count(*) brings up anything greater than 0 then the
users has already submitted an entry and receives the "Duplicate Entry"
message.  The script stops.  If they are not in the database, then she
script proceeds to the next subroutine that enters the data into the
database.

Thanks,
Andrew


126: sub check_email_exists {
127: 
128: my $countEmail;
129: 
130: $countEmail = $dbh->selectrow_array ("select count(*) from
nationalConsumerShoppingSurvey 131: where participantEmail =
'$participantEmail'") or die "Cannot execute: $!";
132: 
133: $countEmail = int($countEmail);
134: 
135: if ($countEmail > 0) {
136:print "Content-type:text/html\n\n";
137:print "Insider's
Advantage\n";
138:print "Duplicate Entry\n";
139:print "It appears that you have already submitted answers\n";
140:print "to this survey.  We appreciate your interest.  However, in
\n";
141:print "order to maintain the integrity of the data, we cannot allow
\n";
142:print "you to enter more than once.  We hope that you
understand.\n";
143:print "\n";
144:exit;
145: }
146: 
147: }

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




Re: Membership Database

2003-01-01 Thread Craig Dean
ezdb includes some management tools
http://www.ezperl.com
On Monday 30 December 2002 07:45 am, you wrote:
> On Sun, 29 Dec 2002 15:33:38 -0500, [EMAIL PROTECTED] (Lewis
>
> Kirk) wrote:
> >Anybody know of a simple cgi program for managing a membership
> >database (flatfile or other)? Features should include allowing
> >members to edit certain info with a username password login. Ability
> >to display only certain fields in an html page. Searchable on
> >multiple fields. Easily customizable. Thanks!
>
> dbman is free to use for non-profits or personal use,
> shareware for profit use.
> It's easy, and works well.
>
> http://www.gossamer-threads.com/scripts/dbman/


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




Re: Membership Database

2002-12-30 Thread zentara
On Sun, 29 Dec 2002 15:33:38 -0500, [EMAIL PROTECTED] (Lewis
Kirk) wrote:

>Anybody know of a simple cgi program for managing a membership 
>database (flatfile or other)? Features should include allowing 
>members to edit certain info with a username password login. Ability 
>to display only certain fields in an html page. Searchable on 
>multiple fields. Easily customizable. Thanks!

dbman is free to use for non-profits or personal use,
shareware for profit use.
It's easy, and works well.

http://www.gossamer-threads.com/scripts/dbman/


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




Membership Database

2002-12-29 Thread Lewis Kirk
Anybody know of a simple cgi program for managing a membership 
database (flatfile or other)? Features should include allowing 
members to edit certain info with a username password login. Ability 
to display only certain fields in an html page. Searchable on 
multiple fields. Easily customizable. Thanks!
--

Lewis Kirk
DMZ Graphics / Owner/Operator
http://www.dmzgraphics.com
http://www.artbarsc.com http://www.lewisandclarklamps.com 
http://www.congareepharmacy.com http://www.srhoadsarchitect.com

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



Re: pop-up window with database access

2002-09-30 Thread zentara

On Mon, 30 Sep 2002 11:47:37 -0500, [EMAIL PROTECTED] (Scot Robnett)
wrote:

>Define "a lot of people."

I just did a quick google search for javascript statistics, and most
of the surveys show somewhere between 10% and 15 % of people
have disabled javascript.

>I guess it depends how important the pop-up function is to the project. Perl
>and MySQL are quite capable of handling the back end, but they're not going
>to manage this function.

Well you can design your page to not need javascript. Like use frames,
with a small frame for you to display your "pop-up data" in, keep some
nice logo in there otherwise. Or  you can always just pop open a new
browser windowit isn't as cute and a tiny window, but it will always
work.




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




Re: pop-up window with database access

2002-09-30 Thread david

Jim Lundeen wrote:

> Hello,
> 
> I'm creating a web site for our department at my school.  We have a
> sign-up form for a society that people can join.  I want to create a
> MySQL database of university names and allow the user to click on a
> "Lookup" button on the sign-up form when they get to the field
> "University Affiliation" and the pop-up window would then go out and get
> a list of universities in the database and allow them to select the
> university they are with, then the selected value would be put in the
> correct text box on the main page form.  I would guess that
> JavaScript is involved, but I don't know.
> 
> Any help (detailed help!) would be very much appreciated by many
> students and professors from around the world!
> 
> Jimmy James

yeah. javascript seems like a good choice for this kind of client side 
pop-up window stuff. :-)

i don't know how much help we can provide here unless you tell us at least 
what have you try. what your plan is. any problems(be specific) you 
encounter.

david

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




RE: pop-up window with database access

2002-09-30 Thread Scot Robnett

Define "a lot of people." I use Pop-Up Stopper myself, but when there is a
popup window that I *want* to see, I can CTRL-click the link. I don't have
to turn Javascript off. Most browsers are preconfigured to allow Javascript
and the user or the company has to explicitly turn it off.

I agree that it's probably going to cover more ground if he keeps the user
experience within the main browser window. 95% of the clients I deal with
still have Javascript enabled. But 100% of them can see what's going on in
their browser, so you have a point.

I guess it depends how important the pop-up function is to the project. Perl
and MySQL are quite capable of handling the back end, but they're not going
to manage this function.

Scot R.
inSite


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
zentara
Sent: Monday, September 30, 2002 11:30 AM
To: [EMAIL PROTECTED]
Subject: Re: pop-up window with database access


On Mon, 30 Sep 2002 10:28:51 -0500, [EMAIL PROTECTED] (Scot Robnett)
wrote:

>"Avoid Javascript" is a pretty far-reaching statement. If you want to
launch
>a popup window, Perl isn't going to do that, Javascript is. It only takes
>one or two lines of client-side code. There are easy-to-follow Javascript

Yeah, you are right. But alot of people keep javascript disabled, so if
you design your site expecting people to use it, you will be
dissapointed.  I've turned off "pop-up javascript windows" in my mozilla
preferences because there are so many annoying pop-ads now.




--
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: pop-up window with database access

2002-09-30 Thread zentara

On Mon, 30 Sep 2002 10:28:51 -0500, [EMAIL PROTECTED] (Scot Robnett)
wrote:

>"Avoid Javascript" is a pretty far-reaching statement. If you want to launch
>a popup window, Perl isn't going to do that, Javascript is. It only takes
>one or two lines of client-side code. There are easy-to-follow Javascript

Yeah, you are right. But alot of people keep javascript disabled, so if
you design your site expecting people to use it, you will be
dissapointed.  I've turned off "pop-up javascript windows" in my mozilla
preferences because there are so many annoying pop-ads now.




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




RE: pop-up window with database access

2002-09-30 Thread Scot Robnett

"Avoid Javascript" is a pretty far-reaching statement. If you want to launch
a popup window, Perl isn't going to do that, Javascript is. It only takes
one or two lines of client-side code. There are easy-to-follow Javascript
primers at

http://javascript.internet.com and

http://www.htmlgoodies.com/primers/jsp/jsp_toc.html


With regard to the database functionality, Perl and MySQL are powerful tools
if you have the time and inclination to learn them.

Good reading: 'Learning Perl', 'Perl in a Nutshell', 'CGI Programming with
Perl' and 'Programming the Perl DBI' (all O'Reilly books). There is also an
O'Reilly MySQL book but I forget the name of it. Actually the documentation
that comes with the MySQL distribution is quite good.

http://www.mysql.com/doc/en/index.html

I also like the SAMS series of SQL books ('Teach Yourself SQL in ...').

This is really a time and learning curve issue. If you don't have much time,
maybe an off-the-shelf CGI is the answer. But I think you'll probably get
more benefit in the long run if you go through the steps of building it
yourself.

HTH,
Scot R.
inSite



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
zentara
Sent: Monday, September 30, 2002 10:02 AM
To: [EMAIL PROTECTED]
Subject: Re: pop-up window with database access


On Fri, 27 Sep 2002 14:43:50 -0400, [EMAIL PROTECTED] (Jim Lundeen)
wrote:

>Hello,
>
>I'm creating a web site for our department at my school.  We have a
>sign-up form for a society that people can join.  I want to create a
>MySQL database of university names and allow the user to click on a
>"Lookup" button on the sign-up form when they get to the field
>"University Affiliation" and the pop-up window would then go out and get
>a list of universities in the database and allow them to select the
>university they are with, then the selected value would be put in the
>correct text box on the main page form.  I would guess that
>JavaScript is involved, but I don't know.
>
>Any help (detailed help!) would be very much appreciated by many
>students and professors from around the world!

If you have limited perl knowledge, it will take you some time
to develope this yourself, maybe a month?
You might be better off buying an existing package which does
this.for instance
http://www.gossamer-threads.com/scripts/dbman/index.htm


P.S. Avoid javascript. It will cause you headaches. :-)



--
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: pop-up window with database access

2002-09-30 Thread zentara

On Fri, 27 Sep 2002 14:43:50 -0400, [EMAIL PROTECTED] (Jim Lundeen)
wrote:

>Hello,
>
>I'm creating a web site for our department at my school.  We have a
>sign-up form for a society that people can join.  I want to create a
>MySQL database of university names and allow the user to click on a
>"Lookup" button on the sign-up form when they get to the field
>"University Affiliation" and the pop-up window would then go out and get
>a list of universities in the database and allow them to select the
>university they are with, then the selected value would be put in the
>correct text box on the main page form.  I would guess that
>JavaScript is involved, but I don't know.
>
>Any help (detailed help!) would be very much appreciated by many
>students and professors from around the world!

If you have limited perl knowledge, it will take you some time
to develope this yourself, maybe a month?
You might be better off buying an existing package which does
this.for instance
http://www.gossamer-threads.com/scripts/dbman/index.htm


P.S. Avoid javascript. It will cause you headaches. :-)



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




RE: pop-up window with database access

2002-09-27 Thread Kipp, James

First work on your back end DB (mySql). Then you probably want to install
the DBI module. 
The front end can be done with HTML and CGI, maybe javascript. Break this
project into pieces and then post questions to this list and the DBI and CGI
list as you progress.
I would break it down like this:

1. Build and populate your DB
2. Design your front end Pages and query forms, pop up windows, etc (HTML,
XML, javascript ...)
3. Install DBI and the DBD (for mysql ) modules and try some test queries to
your DB. read 'perldoc DBI'. You can download these modules here:
http://www.cpan.org/modules/by-module/DBD/ and here:
http://www.cpan.org/modules/by-module/DBI/
some links: http://www.perl.com/lpt/a/1999/10/DBI.html
http://www.danchan.com/feature/2000/10/16/mysql/mysql3.htm
http://www.saturn5.com/~jwb/dbi-examples.html

4. Write your cgi scripts to link your front end forms with your db and do
dynamic cool stuff. 

Here is a list of perl mailing list:
http://lists.perl.org/







> -Original Message-
> From: Jim Lundeen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 27, 2002 2:44 PM
> To: begin begin; perlbegin
> Subject: pop-up window with database access
> 
> 
> Hello,
> 
> I'm creating a web site for our department at my school.  We have a
> sign-up form for a society that people can join.  I want to create a
> MySQL database of university names and allow the user to click on a
> "Lookup" button on the sign-up form when they get to the field
> "University Affiliation" and the pop-up window would then go 
> out and get
> a list of universities in the database and allow them to select the
> university they are with, then the selected value would be put in the
> correct text box on the main page form.  I would guess that
> JavaScript is involved, but I don't know.
> 
> Any help (detailed help!) would be very much appreciated by many
> students and professors from around the world!
 


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




pop-up window with database access

2002-09-27 Thread Jim Lundeen

Hello,

I'm creating a web site for our department at my school.  We have a
sign-up form for a society that people can join.  I want to create a
MySQL database of university names and allow the user to click on a
"Lookup" button on the sign-up form when they get to the field
"University Affiliation" and the pop-up window would then go out and get
a list of universities in the database and allow them to select the
university they are with, then the selected value would be put in the
correct text box on the main page form.  I would guess that
JavaScript is involved, but I don't know.

Any help (detailed help!) would be very much appreciated by many
students and professors from around the world!

Jimmy James



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




Re: Database Normalization ?

2002-09-21 Thread Janek Schleicher

Mmkhajah wrote at Sat, 21 Sep 2002 13:20:14 +0200:

>  I wonder if it's better to use database normalization solution when dealing with 
>Flat Files databases ?

And your Perl-CGI question is ... ?

It's a good question,
but I think you better should ask it in a database newsgroup.

The only answer I can give you in the sort is,
it depends 
(on your specific problem, we don't know).


Greetings,
Janek


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




Database Normalization ?

2002-09-21 Thread MMKHAJAH

Hello Everyone,
 I wonder if it's better to use database normalization solution when dealing with Flat 
Files databases ?



Re: database execute status

2002-08-30 Thread Wiggins d'Anconia

 From > perldoc DBI

  $rc  = $h->err;
  $str = $h->errstr;
  $rv  = $h->state;

You should look at the docs for DBI, error handling is described in 
detail. That should get you started

http://danconia.org



aman cgiperl wrote:
> Hi All
> Is there a way to check the status of $sth->execute; to check if it successfully 
>executed.
> Also if I pass on a query to a mysql database using perl's DBI, and suppose it runs 
>into error, how can I capture that error.
> Thank you
> Aman
> 



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




database execute status

2002-08-30 Thread aman cgiperl

Hi All
Is there a way to check the status of $sth->execute; to check if it successfully 
executed.
Also if I pass on a query to a mysql database using perl's DBI, and suppose it runs 
into error, how can I capture that error.
Thank you
Aman



Re: database connection problem

2002-08-30 Thread Felix Geerinckx

on Fri, 30 Aug 2002 16:46:08 GMT, Aman Cgiperl wrote:

> 12  my $dth = DBI->connect("DBI:mysql:db_name","user","pass");
> 26  my $sth_check = dth->prepare("SELECT * FROM mytab WHERE
 ^

Try 

$dth->prepare(...);
^

-- 
felix

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




RE: database connection problem

2002-08-30 Thread Greg Smith

Try adding the hostname of the MySQL to your connect string.

my $dth =
DBI->connect("DBI:mysql:database=db_name;host=hostname","user","pass");

Greg


> -Original Message-
> From: aman cgiperl [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 30, 2002 10:46 AM
> To: [EMAIL PROTECTED]
> Subject: database connection problem
>
>
> Hello everyone
> I am doing the following
>
> -
>  1  #!/usr/bin/perl
>  2
>  3  use strict;
>  4  use CGI qw(:standard);
>  5  use CGI::Carp qw(fatalsToBrowser);
>  6  use DBI;
>  7
>  8  print header;
>  9  print start_html();
> 10 $s = 'aman';
>
> 12  my $dth = DBI->connect("DBI:mysql:db_name","user","pass");
> 26  my $sth_check = dth->prepare("SELECT * FROM mytab WHERE s='$s'");
> 28  sth_check->execute;
> 41  $dth->disconnect;
>
> 137  print end_html;
>
> ---
> I am getting the following output. What could be wrong ???
> --
> Content-type: text/html
> Software error:
> Can't locate object method "prepare" via package "dth" (perhaps
> you forgot to load "dth"?) at /home/somesite/cgi-bin/script line 26.
>
> For help, please send mail to the webmaster
> ([EMAIL PROTECTED]), giving this error message and the time
> and date of the error.
>
>


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




database connection problem

2002-08-30 Thread aman cgiperl

Hello everyone
I am doing the following

-
 1  #!/usr/bin/perl
 2
 3  use strict;
 4  use CGI qw(:standard);
 5  use CGI::Carp qw(fatalsToBrowser);
 6  use DBI;
 7
 8  print header;
 9  print start_html();
10 $s = 'aman';

12  my $dth = DBI->connect("DBI:mysql:db_name","user","pass");
26  my $sth_check = dth->prepare("SELECT * FROM mytab WHERE s='$s'");
28  sth_check->execute;
41  $dth->disconnect;

137  print end_html;

---
I am getting the following output. What could be wrong ???
--
Content-type: text/html 
Software error:
Can't locate object method "prepare" via package "dth" (perhaps you forgot to load 
"dth"?) at /home/somesite/cgi-bin/script line 26.

For help, please send mail to the webmaster ([EMAIL PROTECTED]), giving this 
error message and the time and date of the error. 




RE: database update

2002-08-16 Thread Bander, James L.

Check what you are trying to do in the SQL.  You are setting CustNo =
$custNo and PIN = $pin WHERE they already have those values.  This is not
causing your parser problem, but it might be a source of confusion.

Cheers,
Jim

-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 4:29 PM
To: 'Rob'; [EMAIL PROTECTED]
Subject: RE: database update


> -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]




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]




RE: database update

2002-08-15 Thread Kipp, James

use the quote() method or placeholders. both are described in 'perldoc DBI'

> -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?
> 
> 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]
> 
> 


-- 
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]




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: PerlDesk Help (Help With Database Host)

2002-06-25 Thread Jordan Mclain

Please let us know a little bit more about your setup.  i.e. have you
already installed mysql or are you running it on a remote server, what
OS are you running?

to connect to the mysql server from perl you will have to use the DBI
module, and the DBD:mysql module.

this is a link you may find useful:
http://www.perldoc.com/perl5.6.1/lib/DBI.html

if you are asking where mysql physically is on your machine; this
depends on what operating system you are running, where you installed
it, where your package manager installed it, or where it came default on
your system.

another link that will tell you more about the mysql server itself is:
http://mysql.org/

Jordan Mclain


On Tue, 2002-06-25 at 19:33, [EMAIL PROTECTED] wrote:
> I have installed PerlDesk onto my server.  Everything is fine, except that I 
> cannot located the database host.  Im not to good with MySQL and all, but if 
> someone could please direct me to right spot to find this, I would really 
> appreciate it.
> 
> Thanks in Advance




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




Re: calling sub based on database list?

2002-06-24 Thread perl-dvd

No, this is quite a simple problem actually.  Here's how.

my $alias = "home|htmlBody,Header,homebody,footer";
my ($name, $subs) =  split(/\|/, $alias);
my @subs = split(/\,/, $subs);
foreach $sub(@subs){
my $return_val = &{$sub}($pass_in_vars);
}

So the first part I assume you've got where you pull your strings into vars, but 
don't put the &
on the front of them.  Then what you are doing with &{$sub}($pass_in_vars); is you are 
taking the
string "htmlBody" or whatever and saying I want to execute a sub called whatever 
string is in $sub.
You use the same method as when you are dereferencing say an array ref. For example

my $stuff = ["first element", "second element", "third element"];
my @thearray = @{$stuff};

Same technique.

Regards,
David


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 21, 2002 9:58 AM
Subject: calling sub based on database list?


Ok, I got sorta a hard question that involves calling randomly changing 
subrutines. What
I'm Trying to do is this.  5 libaries are required into my CGI(PERL) program Each of 
them has their
own set of subrutines.  Now when someone accesses my site they also send a page 
referance eg
"main.cgi?page=home"  What im trying to get my code to do is take 'home' and then 
start runing
subrutines based on a file entry that can be edited from my admin section of this 
site.  So basicly
the file looks like this.

home|&htmlBody,&Header,&homebody,&footer

So it should get the list of subrutined to call but I can not figure out how to call 
them since they
are strings and not hard coded into the code.  Basicly I can get the values and print 
them out but
not call them.  Does anyone have and tips for calling a sub using the name from a 
string?
perl.call('htmlBody') does not work as one site pointed out. I guess thats for 
something else all
together.  Thanx

Chris

--
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]




calling sub based on database list?

2002-06-21 Thread WyvernGod

Ok, I got sorta a hard question that involves calling randomly changing 
subrutines. What I'm Trying to do is this.  5 libaries are required into my CGI(PERL) 
program Each of them has their own set of subrutines.  Now when someone accesses my 
site they also send a page referance eg "main.cgi?page=home"  What im trying to get my 
code to do is take 'home' and then start runing subrutines based on a file entry that 
can be edited from my admin section of this site.  So basicly the file looks like this.

home|&htmlBody,&Header,&homebody,&footer

So it should get the list of subrutined to call but I can not figure out how to call 
them since they are strings and not hard coded into the code.  Basicly I can get the 
values and print them out but not call them.  Does anyone have and tips for calling a 
sub using the name from a string? perl.call('htmlBody') does not work as one site 
pointed out. I guess thats for something else all together.  Thanx

Chris

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




Re: What database would your recommend?

2002-06-07 Thread fliptop

Paul Arsenault wrote:

> database.  As for transactions, only very high-end commercial databases 
> (such as your friend's Oracle) support transactions.  They are only 


that's not true - postgresql supports transactions.

and according to this page:

http://www.mysql.com/doc/I/n/InnoDB_transaction_model.html

mysql now supports them also.


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




Re: What database would your recommend?

2002-06-07 Thread Paul Arsenault

Relational databasing just means that there are keys associated between the 
different databases that allows the database software to easily make matches 
from one database table to another very quickly and efficiently.  I don't 
know if you've ever heard the term "primary key" before, but it simply 
refers to a unique identifier that is common to the database tables and 
uniquely identifies one and only one object in each of the databases.  I 
believe that's what makes up a relational database.  As for transactions, 
only very high-end commercial databases (such as your friend's Oracle) 
support transactions.  They are only required in applications such as 
real-time transactions.  For example...Etrade.com would use Oracle probably 
to control all trading, and amazon.com would use Oracle to control all 
inventory and purchases.  I hope this answers some of your questions.



Paul Arsenault, CCNA
[EMAIL PROTECTED]


_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




Re: What database would your recommend?

2002-06-07 Thread David T-G

Paul, et al --

...and then Paul Arsenault said...
% 
% MySQL is a relational database.

I've followed up and have more information -- sort of.  My pal couldn't
provide hard data but pointed not only to extra stuff like transactions
(I don't think anyone is saying that transactions are part of what makes
up relational) but stored procedures, foreign keys, and better joins.
Perhaps the difference in "relational" and "whopping big powerful
relational".

Good news for me, though, because mysql is available out of the box at
my server and I can still learn not just DB but RDB interfacing.  Thanks
a lot for the pointer!


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05263/pgp0.pgp
Description: PGP signature


Re: What database would your recommend?

2002-06-07 Thread David T-G

Paul --

Thanks for the reply.

...and then Paul Arsenault said...
% 
% MySQL is a relational database.
% 
% Taken from the mysql documentation page at 
% http://www.mysql.org/documentation/mysql/bychapter/manual_Introduction.html#Features
% 
% MySQL is a relational database management system.

Hmmm...  That is a pretty compelling point :-)


% A relational database stores data in separate tables rather than putting 
% all the data in one big storeroom. This adds speed and flexibility. The 
% tables are linked by defined relations making it possible to combine data 
% from several tables on request. The SQL part of ``MySQL'' stands for 
% ``Structured Query Language''@-the most common standardised language used 
% to access databases.

OK, I get that.  I still have to figure out what relations really are
(example help but I don't deal with employees and salaries so *my*
examples would probably be more helpful :-) but I got this from a couple
of DB buddies, one of whom had been a long-time mysql lover but had
turned to pgres because he ran into problems under mysql (the other guy,
a die-hard Oracle man, will use nothing else anyway).  Now I have to go
back and pin him down on what he meant since his statement so obviously
contradicts the docs.


% 
% 
% Paul Arsenault, CCNA
% [EMAIL PROTECTED]


Thanks & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05259/pgp0.pgp
Description: PGP signature


Re: [OT] Re: What database would your recommend?

2002-06-07 Thread David T-G

John, et al --

...and then John Brooking said...
% 
% Not to be pedantic, but isn't PHP a *language*, not a
% database? So you could use almost any particular

Yes, it is; it doesn't have its own database built in.  For someone
starting out doing web stuff it wouldn't be bad to pick up, even if it
isn't a four-letter word.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05258/pgp0.pgp
Description: PGP signature


[OT] Re: What database would your recommend?

2002-06-07 Thread John Brooking

Not to be pedantic, but isn't PHP a *language*, not a
database? So you could use almost any particular
database with either PHP or Perl. Or does PHP have
it's own built-in database and that's what you meant?

(I looked at PHP a little once, and I have to admit a
knee-jerk negative reaction to a language that relies
on indentation for intuiting program flow. [Please
avoid copying this list on any religious responses to
that last sentence; take it up with me personally if
you must.])

Of course, if we're being pedantic, I would point out
that this whole thread has been off-topic from the
start, but just I'll content myself with prefixing the
subject with "[OT]".

- John

--- Fred Sahakian <[EMAIL PROTECTED]> wrote:
> depends what you need to do, PHP has become VERY
> popular
> 


=
"Now it's over, I'm dead, and I haven't done anything that I want; or, I'm still 
alive, and there's nothing I want to do." - They Might Be Giants, http://www.tmbg.com

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




RE: What database would your recommend?

2002-06-07 Thread James Kelty

I would go for Postgres, if I were you. Relational, transactions, and
foreign key assignments. May be a little slower than MySQL, but pretty much
the same in stability.

-James


-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 7:59 PM
To: [EMAIL PROTECTED]
Subject: What database would your recommend?


Hi all,

I want to start learning a database that works with Perl but I would like to
learn a database that works under Windows and Unix also.

Is there such a thing?
Of course, I would like to  learn something as simple as possible because I
am a beginner in Perl.

Thank you.

Teddy,
[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: What database would your recommend?

2002-06-07 Thread Fred Sahakian

dont put your eggs in one basket, as they say...

>>> "Mike Rapuano" <[EMAIL PROTECTED]> 06/07/02 12:24PM >>>
Camilo --

If you've done any research at all you would know that learning perl
will not make you less marketable.  And if I were you, I would not
"Marry myself" to one scripting language;)

Mike


-Original Message- 
From: Camilo Gonzalez 
Sent: Fri 6/7/2002 12:12 PM 
To: 'Nikola Janceski'; Camilo Gonzalez; 'Fred Sahakian';
[EMAIL PROTECTED] 
Cc: < 
Subject: RE: What database would your recommend?



Forgive me Nikola. In this business you need to stay as
marketable as
possible. I don't want to go to a potential employer with six
years of Perl
on my resume, to be beaten out by somebody with 2 years of PHP
on theirs.

-Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 11:06 AM
To: 'Camilo Gonzalez'; 'Fred Sahakian'; [EMAIL PROTECTED]
Cc: <
Subject: RE: What database would your recommend?


Perl a dying language?

are you nutz?!?!?!

Haven't you been reading the Apocalypse pages for PERL 6??!?!?
http://dev.perl.org/perl6/apocalypse/  apocalypse 1-4
http://www.perl.com/pub/a/2002/06/04/apo5.html apocalypse 5
(pattern
matching will never be the same)

I get a w**dy just thinking about it.



> -Original Message-
> From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 11:57 AM
> To: 'Fred Sahakian'; [EMAIL PROTECTED]
> Cc: <
> Subject: RE: What database would your recommend?
>
>
> That's a good point. Are there still advantages to using Perl
> over using
> PHP? I'd be bummed to hear I'm using a dying language.
>
> -Original Message-----
> From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 10:52 AM
> To: [EMAIL PROTECTED]
> Cc: <
> Subject: Re: What database would your recommend?
>
>
> depends what you need to do, PHP has become VERY popular
>
> >>> "Octavian Rasnita" <[EMAIL PROTECTED]> 06/05/02 10:58PM >>>
> Hi all,
>
> I want to start learning a database that works with Perl but
> I would like to
> learn a database that works under Windows and Unix also.
>
> Is there such a thing?
> Of course, I would like to  learn something as simple as
> possible because I
> am a beginner in Perl.
>
> Thank you.
>
> Teddy,
> [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]
>





The views and opinions expressed in this email message are the
sender's
own, and do not necessarily represent the views and opinions of
Summit
Systems Inc.

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





RE: What database would your recommend?

2002-06-07 Thread Mike Rapuano

Camilo --
 
If you've done any research at all you would know that learning perl
will not make you less marketable.  And if I were you, I would not
"Marry myself" to one scripting language;)
 
Mike
 

-Original Message- 
From: Camilo Gonzalez 
Sent: Fri 6/7/2002 12:12 PM 
To: 'Nikola Janceski'; Camilo Gonzalez; 'Fred Sahakian';
[EMAIL PROTECTED] 
    Cc: < 
Subject: RE: What database would your recommend?



Forgive me Nikola. In this business you need to stay as
marketable as
possible. I don't want to go to a potential employer with six
years of Perl
on my resume, to be beaten out by somebody with 2 years of PHP
on theirs.

-Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 11:06 AM
To: 'Camilo Gonzalez'; 'Fred Sahakian'; [EMAIL PROTECTED]
Cc: <
Subject: RE: What database would your recommend?


Perl a dying language?

are you nutz?!?!?!

Haven't you been reading the Apocalypse pages for PERL 6??!?!?
http://dev.perl.org/perl6/apocalypse/  apocalypse 1-4
http://www.perl.com/pub/a/2002/06/04/apo5.html apocalypse 5
(pattern
matching will never be the same)

I get a w**dy just thinking about it.



> -Original Message-
> From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 11:57 AM
> To: 'Fred Sahakian'; [EMAIL PROTECTED]
> Cc: <
> Subject: RE: What database would your recommend?
>
>
> That's a good point. Are there still advantages to using Perl
> over using
> PHP? I'd be bummed to hear I'm using a dying language.
>
> -Original Message-
> From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 10:52 AM
> To: [EMAIL PROTECTED]
> Cc: <
> Subject: Re: What database would your recommend?
>
>
> depends what you need to do, PHP has become VERY popular
>
> >>> "Octavian Rasnita" <[EMAIL PROTECTED]> 06/05/02 10:58PM >>>
> Hi all,
>
> I want to start learning a database that works with Perl but
> I would like to
> learn a database that works under Windows and Unix also.
>
> Is there such a thing?
> Of course, I would like to  learn something as simple as
> possible because I
> am a beginner in Perl.
>
> Thank you.
>
> Teddy,
> [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]
>





The views and opinions expressed in this email message are the
sender's
own, and do not necessarily represent the views and opinions of
Summit
Systems Inc.

--
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: What database would your recommend?

2002-06-07 Thread Nikola Janceski

well.. I have 6 years Perl.. but I don't do web design, and no PHP
programmer has been me out of a position yet.
I am not shooting down PHP, but Perl has many many advantages over PHP, but
PHP is better for DB access via a web front. But Perl is better at backend
access and overall reporting (not DB reports alone). It's just not a dead or
dying language. I think with Perl 6 it will have much renewed vigour.

Remember all languages have there advantages and disadavantages.

[rant]
C/C++: number crunch/OS masters
Perl: parsing masters
PHP: DB/CGI masters
VB: GUI masters
[/rant]

> -Original Message-
> From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 12:13 PM
> To: 'Nikola Janceski'; Camilo Gonzalez; 'Fred Sahakian';
> [EMAIL PROTECTED]
> Cc: <
> Subject: RE: What database would your recommend?
> 
> 
> Forgive me Nikola. In this business you need to stay as marketable as
> possible. I don't want to go to a potential employer with six 
> years of Perl
> on my resume, to be beaten out by somebody with 2 years of 
> PHP on theirs. 
> 
> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 11:06 AM
> To: 'Camilo Gonzalez'; 'Fred Sahakian'; [EMAIL PROTECTED]
> Cc: <
> Subject: RE: What database would your recommend?
> 
> 
> Perl a dying language?
> 
> are you nutz?!?!?!
> 
> Haven't you been reading the Apocalypse pages for PERL 6??!?!?
> http://dev.perl.org/perl6/apocalypse/  apocalypse 1-4
> http://www.perl.com/pub/a/2002/06/04/apo5.html apocalypse 5 (pattern
> matching will never be the same)
> 
> I get a w**dy just thinking about it.
> 
> 
> 
> > -Original Message-----
> > From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 07, 2002 11:57 AM
> > To: 'Fred Sahakian'; [EMAIL PROTECTED]
> > Cc: <
> > Subject: RE: What database would your recommend?
> > 
> > 
> > That's a good point. Are there still advantages to using Perl 
> > over using
> > PHP? I'd be bummed to hear I'm using a dying language.
> > 
> > -Original Message-
> > From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 07, 2002 10:52 AM
> > To: [EMAIL PROTECTED]
> > Cc: <
> > Subject: Re: What database would your recommend?
> > 
> > 
> > depends what you need to do, PHP has become VERY popular
> > 
> > >>> "Octavian Rasnita" <[EMAIL PROTECTED]> 06/05/02 10:58PM >>>
> > Hi all,
> > 
> > I want to start learning a database that works with Perl but 
> > I would like to
> > learn a database that works under Windows and Unix also.
> > 
> > Is there such a thing?
> > Of course, I would like to  learn something as simple as 
> > possible because I
> > am a beginner in Perl.
> > 
> > Thank you.
> > 
> > Teddy,
> > [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]
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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




RE: What database would your recommend?

2002-06-07 Thread Camilo Gonzalez

Forgive me Nikola. In this business you need to stay as marketable as
possible. I don't want to go to a potential employer with six years of Perl
on my resume, to be beaten out by somebody with 2 years of PHP on theirs. 

-Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 11:06 AM
To: 'Camilo Gonzalez'; 'Fred Sahakian'; [EMAIL PROTECTED]
Cc: <
Subject: RE: What database would your recommend?


Perl a dying language?

are you nutz?!?!?!

Haven't you been reading the Apocalypse pages for PERL 6??!?!?
http://dev.perl.org/perl6/apocalypse/  apocalypse 1-4
http://www.perl.com/pub/a/2002/06/04/apo5.html apocalypse 5 (pattern
matching will never be the same)

I get a w**dy just thinking about it.



> -Original Message-
> From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 11:57 AM
> To: 'Fred Sahakian'; [EMAIL PROTECTED]
> Cc: <
> Subject: RE: What database would your recommend?
> 
> 
> That's a good point. Are there still advantages to using Perl 
> over using
> PHP? I'd be bummed to hear I'm using a dying language.
> 
> -Original Message-
> From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 10:52 AM
> To: [EMAIL PROTECTED]
> Cc: <
> Subject: Re: What database would your recommend?
> 
> 
> depends what you need to do, PHP has become VERY popular
> 
> >>> "Octavian Rasnita" <[EMAIL PROTECTED]> 06/05/02 10:58PM >>>
> Hi all,
> 
> I want to start learning a database that works with Perl but 
> I would like to
> learn a database that works under Windows and Unix also.
> 
> Is there such a thing?
> Of course, I would like to  learn something as simple as 
> possible because I
> am a beginner in Perl.
> 
> Thank you.
> 
> Teddy,
> [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]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.

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




Re: What database would your recommend?

2002-06-07 Thread Gary Stainburn

Hi all,

Having spoken to consultants/teachers that  I know, their experience matches 
my own.

When teaching, they prefer PHP. When programming they prefer Perl.

It's basically horses for courses.  I use PHP for what it's always been 
designed for which is creating dynamic web content.  For application 
development (batch, console, complex CGI etc) I use Perl.

The big advantage here is that wil PostgreSQL being the back end I can easily 
combine both languages in a project as appropriate.

Gary

On Friday 07 June 2002 4:56 pm, Camilo Gonzalez wrote:
> That's a good point. Are there still advantages to using Perl over using
> PHP? I'd be bummed to hear I'm using a dying language.
>
> -Original Message-
> From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 10:52 AM
> To: [EMAIL PROTECTED]
> Cc: <
> Subject: Re: What database would your recommend?
>
>
> depends what you need to do, PHP has become VERY popular
>
> >>> "Octavian Rasnita" <[EMAIL PROTECTED]> 06/05/02 10:58PM >>>
>
> Hi all,
>
> I want to start learning a database that works with Perl but I would like
> to learn a database that works under Windows and Unix also.
>
> Is there such a thing?
> Of course, I would like to  learn something as simple as possible because I
> am a beginner in Perl.
>
> Thank you.
>
> Teddy,
> [EMAIL PROTECTED]

-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 

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




RE: What database would your recommend?

2002-06-07 Thread Nikola Janceski

Perl a dying language?

are you nutz?!?!?!

Haven't you been reading the Apocalypse pages for PERL 6??!?!?
http://dev.perl.org/perl6/apocalypse/  apocalypse 1-4
http://www.perl.com/pub/a/2002/06/04/apo5.html apocalypse 5 (pattern
matching will never be the same)

I get a w**dy just thinking about it.



> -Original Message-
> From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 11:57 AM
> To: 'Fred Sahakian'; [EMAIL PROTECTED]
> Cc: <
> Subject: RE: What database would your recommend?
> 
> 
> That's a good point. Are there still advantages to using Perl 
> over using
> PHP? I'd be bummed to hear I'm using a dying language.
> 
> -Original Message-
> From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 07, 2002 10:52 AM
> To: [EMAIL PROTECTED]
> Cc: <
> Subject: Re: What database would your recommend?
> 
> 
> depends what you need to do, PHP has become VERY popular
> 
> >>> "Octavian Rasnita" <[EMAIL PROTECTED]> 06/05/02 10:58PM >>>
> Hi all,
> 
> I want to start learning a database that works with Perl but 
> I would like to
> learn a database that works under Windows and Unix also.
> 
> Is there such a thing?
> Of course, I would like to  learn something as simple as 
> possible because I
> am a beginner in Perl.
> 
> Thank you.
> 
> Teddy,
> [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]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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




RE: What database would your recommend?

2002-06-07 Thread Fred Sahakian

99% of my databases have been small, so flatfile databases are fine, the Perl can 
handle it as well as the servers.  When you get into hundreds of thousands of records, 
that's different-- then you need something stable, fast, and flexible.

>>> Camilo Gonzalez <[EMAIL PROTECTED]> 06/07/02 11:56AM >>>
That's a good point. Are there still advantages to using Perl over using
PHP? I'd be bummed to hear I'm using a dying language.

-Original Message-
From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 10:52 AM
To: [EMAIL PROTECTED]
Cc: <
Subject: Re: What database would your recommend?


depends what you need to do, PHP has become VERY popular

>>> "Octavian Rasnita" <[EMAIL PROTECTED]> 06/05/02 10:58PM >>>
Hi all,

I want to start learning a database that works with Perl but I would like to
learn a database that works under Windows and Unix also.

Is there such a thing?
Of course, I would like to  learn something as simple as possible because I
am a beginner in Perl.

Thank you.

Teddy,
[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: What database would your recommend?

2002-06-07 Thread Camilo Gonzalez

That's a good point. Are there still advantages to using Perl over using
PHP? I'd be bummed to hear I'm using a dying language.

-Original Message-
From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 10:52 AM
To: [EMAIL PROTECTED]
Cc: <
Subject: Re: What database would your recommend?


depends what you need to do, PHP has become VERY popular

>>> "Octavian Rasnita" <[EMAIL PROTECTED]> 06/05/02 10:58PM >>>
Hi all,

I want to start learning a database that works with Perl but I would like to
learn a database that works under Windows and Unix also.

Is there such a thing?
Of course, I would like to  learn something as simple as possible because I
am a beginner in Perl.

Thank you.

Teddy,
[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: What database would your recommend?

2002-06-07 Thread Fred Sahakian

depends what you need to do, PHP has become VERY popular

>>> "Octavian Rasnita" <[EMAIL PROTECTED]> 06/05/02 10:58PM >>>
Hi all,

I want to start learning a database that works with Perl but I would like to
learn a database that works under Windows and Unix also.

Is there such a thing?
Of course, I would like to  learn something as simple as possible because I
am a beginner in Perl.

Thank you.

Teddy,
[EMAIL PROTECTED]



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



Re: What database would your recommend?

2002-06-07 Thread Paul Arsenault

MySQL is a relational database.

Taken from the mysql documentation page at 
http://www.mysql.org/documentation/mysql/bychapter/manual_Introduction.html#Features

MySQL is a relational database management system.
A relational database stores data in separate tables rather than putting all 
the data in one big storeroom. This adds speed and flexibility. The tables 
are linked by defined relations making it possible to combine data from 
several tables on request. The SQL part of ``MySQL'' stands for ``Structured 
Query Language''@-the most common standardised language used to access 
databases.


Paul Arsenault, CCNA
[EMAIL PROTECTED]


>From: David T-G <[EMAIL PROTECTED]>
>To: perl beginners cgi <[EMAIL PROTECTED]>
>CC: Octavian Rasnita <[EMAIL PROTECTED]>
>Subject: Re: What database would your recommend?
>Date: Fri, 7 Jun 2002 10:32:25 -0500
>
>Teddy --
>
>...and then Octavian Rasnita said...
>%
>% Hi all,
>
>Hello!
>
>
>%
>% I want to start learning a database that works with Perl but I would like 
>to
>% learn a database that works under Windows and Unix also.
>
>mysql is a lean, fast, excellent choice.  I'm looking into the same sort
>of question, though, and have found that mysql is not relational (and
>also takes some other shortcuts), and so if you just want *a* database
>it's fine but if you want to learn on one so that you can grow into
>another PostgreSQL might be better; it's relational and much more like
>the big guys.  It is, of course, available for Linux, and although I
>don't know about a native Win32 port I do know that it's now available
>under Cygwin.
>
>
>%
>% Is there such a thing?
>
>Of course :-)
>
>
>% Of course, I would like to  learn something as simple as possible because 
>I
>% am a beginner in Perl.
>
>If you *really* want to keep it simple, be sure to use DBI and do your
>calls through there so that you don't go falling off into specifics of
>each database.  From what I've found, DBI code is extremely portable,
>while writing your own SQL gets messy.
>
>
>%
>% Thank you.
>
>HTH & HAND
>
>
>%
>% Teddy,
>% [EMAIL PROTECTED]
>
>
>:-D
>--
>David T-G  * It's easier to fight for one's principles
>(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
>(work) [EMAIL PROTECTED]
>http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
>
><< attach3 >>


_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




Re: What database would your recommend?

2002-06-07 Thread fliptop

David T-G wrote:

> mysql is a lean, fast, excellent choice.  I'm looking into the same sort
> of question, though, and have found that mysql is not relational (and
> also takes some other shortcuts), and so if you just want *a* database
> it's fine but if you want to learn on one so that you can grow into
> another PostgreSQL might be better; it's relational and much more like
> the big guys.  It is, of course, available for Linux, and although I
> don't know about a native Win32 port I do know that it's now available
> under Cygwin.


if you're learning about databases and sql for the 1st time, use mysql. 
  its documentation is excellent.

i would not recommend postgresql for a beginner, since the documentation 
leaves a lot to be desired when compared to the documentation for mysql.


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




Re: What database would your recommend?

2002-06-07 Thread David T-G

Teddy --

...and then Octavian Rasnita said...
% 
% Hi all,

Hello!


% 
% I want to start learning a database that works with Perl but I would like to
% learn a database that works under Windows and Unix also.

mysql is a lean, fast, excellent choice.  I'm looking into the same sort
of question, though, and have found that mysql is not relational (and
also takes some other shortcuts), and so if you just want *a* database
it's fine but if you want to learn on one so that you can grow into
another PostgreSQL might be better; it's relational and much more like
the big guys.  It is, of course, available for Linux, and although I
don't know about a native Win32 port I do know that it's now available
under Cygwin.


% 
% Is there such a thing?

Of course :-)


% Of course, I would like to  learn something as simple as possible because I
% am a beginner in Perl.

If you *really* want to keep it simple, be sure to use DBI and do your
calls through there so that you don't go falling off into specifics of
each database.  From what I've found, DBI code is extremely portable,
while writing your own SQL gets messy.


% 
% Thank you.

HTH & HAND


% 
% Teddy,
% [EMAIL PROTECTED]


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05240/pgp0.pgp
Description: PGP signature


RE: What database would your recommend?

2002-06-07 Thread Joel Hughes

MySQL sounds like your answer Teddy. Runs perfectly well on Linux and
Windows.


-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
Sent: 06 June 2002 03:59
To: [EMAIL PROTECTED]
Subject: What database would your recommend?


Hi all,

I want to start learning a database that works with Perl but I would like to
learn a database that works under Windows and Unix also.

Is there such a thing?
Of course, I would like to  learn something as simple as possible because I
am a beginner in Perl.

Thank you.

Teddy,
[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]




What database would your recommend?

2002-06-06 Thread Octavian Rasnita

Hi all,

I want to start learning a database that works with Perl but I would like to
learn a database that works under Windows and Unix also.

Is there such a thing?
Of course, I would like to  learn something as simple as possible because I
am a beginner in Perl.

Thank you.

Teddy,
[EMAIL PROTECTED]



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




This is what I am doing to connect toa database :

2002-05-02 Thread Kamali Muthukrishnan

This is what I am doing to connect toa database :
#Windows-based Perl/DBI/MS Access access
 use DBI;

 #open connection to Access database
 $dbh = DBI->connect('dbi:ODBC:MSMuseum');

 #prepare and execute SQL statement
 $sqlstatement="SELECT * FROM Product";
 $sth = $dbh->prepare($sqlstatement);
 $sth->execute || 
   die "Could not execute SQL statement ... maybe invalid?";

 #output database results
 while (@row=$sth->fetchrow_array)
  { print "@row\n" }

I am using a DSN for my database. One of the websites I visited said that you can 
connect to the database without a DSN.  How is that done ?
Kamali


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




RE: Perl DATABASE Forms

2002-03-22 Thread Scot Robnett

CGI::State might do some good also, although it's not going to compensate
completely for a true stateful session.

Scot R.



-Original Message-
From: Brice, Charles [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 12:48 PM
To: 'David Kirol' (Receipt Notification Requested) (IPM Return
Requested)
Cc: '[EMAIL PROTECTED]' (Receipt Notification Requested)
Subject: RE: Perl DATABASE Forms


Hi David
I am new to Perl.
  Our sys admin has Apache installed and is setting up for us to use Perl,
DBI, CGI.

Thanks for responding
Charles

-Original Message-
From: David Kirol [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:40 PM
To: Brice, Charles
Subject: RE: Perl DATABASE Forms


Charles Brice,
Start with DBI and DBD:Oracle. That will handle the connectivity issues
(connect DDL DML). Next comes CGI. Your going to need good old HTML forms
and CGI was easy enough for me to learn and use, but beware - with HTML you
lose the all important issue of STATE. In Forms 6i, I click a button on the
form I made and the form I am looking at on the screen is then current
(ignoring rollback for the moment). HTML on the other hand is stateless
meaning after I hit the submit button on an HTML form you will not get the
automatic alert you see in Forms when something is amiss. To show an alert
in HTML you'll need to make an alert page and display it and pass the state
information along with it. Are you currently versed with perl?

-Original Message-
From: Brice, Charles [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:19 PM
To: '[EMAIL PROTECTED]' (Receipt Notification Requested)
Cc: Brice, Charles (Receipt Notification Requested) (IPM Return
Requested)
Subject: Perl DATABASE Forms


Hi all

I work in an ORACLE Forms environment. The client is switching to Perl.  Is
it possible
to create a complete data entry system for the Web using Perl?  ORACLE Forms
allows you
to create multiple data entry blocks in a form and to support "1 to many 1
to many" relationships
using multiple tables.  One form can be used to perform the QUERY, UPDATE,
DELETE,
and INSERT functions.

Can any one point me to a "HOW TO", or information, or an existing
application available for examination
that demonstrates these capabilities using Perl on the Web?

Thanks for your help
Charles





--
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]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002


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




RE: Perl DATABASE Forms

2002-03-22 Thread Brice, Charles

Hi David
I am new to Perl.
  Our sys admin has Apache installed and is setting up for us to use Perl, DBI, CGI.

Thanks for responding
Charles

-Original Message-
From: David Kirol [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:40 PM
To: Brice, Charles
Subject: RE: Perl DATABASE Forms


Charles Brice,
Start with DBI and DBD:Oracle. That will handle the connectivity issues
(connect DDL DML). Next comes CGI. Your going to need good old HTML forms
and CGI was easy enough for me to learn and use, but beware - with HTML you
lose the all important issue of STATE. In Forms 6i, I click a button on the
form I made and the form I am looking at on the screen is then current
(ignoring rollback for the moment). HTML on the other hand is stateless
meaning after I hit the submit button on an HTML form you will not get the
automatic alert you see in Forms when something is amiss. To show an alert
in HTML you'll need to make an alert page and display it and pass the state
information along with it. Are you currently versed with perl?

-Original Message-
From: Brice, Charles [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:19 PM
To: '[EMAIL PROTECTED]' (Receipt Notification Requested)
Cc: Brice, Charles (Receipt Notification Requested) (IPM Return
Requested)
Subject: Perl DATABASE Forms


Hi all

I work in an ORACLE Forms environment. The client is switching to Perl.  Is
it possible
to create a complete data entry system for the Web using Perl?  ORACLE Forms
allows you
to create multiple data entry blocks in a form and to support "1 to many 1
to many" relationships
using multiple tables.  One form can be used to perform the QUERY, UPDATE,
DELETE,
and INSERT functions.

Can any one point me to a "HOW TO", or information, or an existing
application available for examination
that demonstrates these capabilities using Perl on the Web?

Thanks for your help
Charles





--
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: Perl DATABASE Forms

2002-03-22 Thread Scot Robnett

You might try

Programming the Perl DBI (O'Reilly)

perldoc CGI.pm

perldoc DBI.pm

http://search.cpan.org/doc/JURL/DBD-ODBC-0.39/ODBC.pm

http://search.cpan.org/doc/TIMB/DBD-Oracle-1.12/Oracle.pm

http://www.mysql.com


Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]



-Original Message-
From: Brice, Charles [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 12:19 PM
To: '[EMAIL PROTECTED]' (Receipt Notification Requested)
Cc: Brice, Charles (Receipt Notification Requested) (IPM Return
Requested)
Subject: Perl DATABASE Forms


Hi all

I work in an ORACLE Forms environment. The client is switching to Perl.  Is
it possible
to create a complete data entry system for the Web using Perl?  ORACLE Forms
allows you
to create multiple data entry blocks in a form and to support "1 to many 1
to many" relationships
using multiple tables.  One form can be used to perform the QUERY, UPDATE,
DELETE,
and INSERT functions.

Can any one point me to a "HOW TO", or information, or an existing
application available for examination
that demonstrates these capabilities using Perl on the Web?

Thanks for your help
Charles





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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002


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




Perl DATABASE Forms

2002-03-22 Thread Brice, Charles

Hi all

I work in an ORACLE Forms environment. The client is switching to Perl.  Is it 
possible 
to create a complete data entry system for the Web using Perl?  ORACLE Forms allows you
to create multiple data entry blocks in a form and to support "1 to many 1 to many" 
relationships
using multiple tables.  One form can be used to perform the QUERY, UPDATE, DELETE, 
and INSERT functions.

Can any one point me to a "HOW TO", or information, or an existing application 
available for examination
that demonstrates these capabilities using Perl on the Web?

Thanks for your help
Charles





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




manipulating a BerkeleyDB-database

2002-03-19 Thread peter barth

Hi there,

I'm trying to manipulate an EXISTING BerkeleyDB3.2.9 database.

Everything is working fine if I implement:

unlink $filename

and insert some keys,value pairs.

If I unlink the filename there are no key,value pairs available any more
which existed before, is this normal?

My problem is, that I need to manipulate the content of teh database
which exists, not one I need to generate before.

Any hints for that?

Here is the code:

#!/usr/bin/perl -wT

use strict;
use Fcntl;
use BerkeleyDB;

my $filename = "/root/doms.db";
my $dbvar = tie %domain, 'BerkeleyDB::Btree',
-Filename=> $filename,
-Flags=> DB_CREATE,
-Mode=> 0664
or die "Cannot open $filename: $!\n";

foreach (keys %domain) {
print "$_\n";
}

$dbvar->db_del("any_entry_which_exists_in_databse");

foreach (keys %domain) {
print "$_\n";
}

--->> the second output is exactly as the first

Thank you for your help,

best regs

Peter Barth


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




DataBase Connection and stuff

2001-11-21 Thread Lilian Alvarenga Caravela Godoy

Please, I really, really need some help.

I need to know how to connect to a Database (SQL Server, running under
Windows 2000) throught a Perl CGI(running under Linux). 

I want to select some registries and update another ones.
Is there anybody that knows if thats possible?

Thanks in advance.

Lilian.



RE: Is it a security risk to use identical names for database fields and html forms?

2001-09-06 Thread Curtis Poe

--- Gunther Birznieks <[EMAIL PROTECTED]> wrote:
> There's actually quite a bit of interesting stuff out there that has really 
> only been "discovered" and publicized at all in the last year or two. Null 
> byte is another huge issue few Perl programmers seem to know 
> about/understand as it affects the file open() command in a subtle way yet 
> I think it is not described in perldoc perlsec (it seems mostly focused on 
> tainting and general validation issues).

If anyone's unfamiliar with the null byte problem, I have a brief description of it at
http://www.perlmonks.org/index.pl?node_id=38548.

Cheers,
Curtis "Ovid" Poe

=
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

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




RE: Is it a security risk to use identical names for database fields and html forms?

2001-09-06 Thread Gunther Birznieks

At 12:53 PM 9/3/2001 +0100, yahoo wrote:
>Hi Gunther,
>yes, you are right - maybe my answer was a bit flippent - it was only meant
>to be a conversational addition to the thread rather than a definitive
>answer ;-)
>
>By "access to the DB" I meant a valid SQL login.
>
>I enjoyed reading that URL you posted. Seeing the SQL being returned to the
>web user for his/her inspection is certainly a most worrying situation! Once
>again it reinforces the golden rule that you should NEVER trust (or make
>unfounded assumptions about) user input.
>
>I think that dynamically created SQL statements (such as in the norm in
>MySQL) are very vulnerable to this kind of attack in contrasts to, say,
>using stored procedures.
>
>I enjoyed reading your post :-)

Thanks! I also gave a talk on these issues at this past year's ApacheCon. 
I've placed the slides are up here:

http://www.extropia.com/presentations/cgi_security_history.html

Since me and Selena Sol have been around giving out open source web apps 
since 8 years ago (very early on the Web), we've of course seen the gamut 
of security holes, including those within our own past software.

So this talk was really an attempt (within a tiny 45 minute talk) of going 
through common problems from a long time ago and linking them up to 
problems that are more recent and have gotten little publicity but 2 years 
down the road may be as "rote" as knowing that filenames need to be filtered.

There's actually quite a bit of interesting stuff out there that has really 
only been "discovered" and publicized at all in the last year or two. Null 
byte is another huge issue few Perl programmers seem to know 
about/understand as it affects the file open() command in a subtle way yet 
I think it is not described in perldoc perlsec (it seems mostly focused on 
tainting and general validation issues).

>joel
>
>-Original Message-
>From: Gunther Birznieks [mailto:[EMAIL PROTECTED]]
>Sent: 02 September 2001 01:15
>To: yahoo; [EMAIL PROTECTED]
>Subject: RE: Is it a security risk to use identical names for database
>fields and html forms?
>
>
>At 02:29 PM 8/31/2001 +0100, yahoo wrote:
> >nah!
> >
> >what difference does it make?
> >
> >I mean, if they guy gets access to your DB server then he's gonna find out
> >the fieldnames anyway!
> >
> >If he can't get access to your DB then what has he got?, a few POSSIBLE DB
> >field names (i mean, how does HE know the names are real?) for him to
> >attempt to recreate fragments of the data model pah! best of luck...
> >
> >
> >joel
>
>Joel, while I do think that this is a nice succinct reply to the thread, I
>am not sure that it really uncovers the entire problem. It's a bit hard to
>understand what you mean in your post as you don't really qualify the
>phrase "access to the DB". Sure, if I have a TCP stream to mySQL, it's
>possible to get anything.
>
>But "access to a database" through exploiting CGI is not always perfect and
>therefore being able to glean extra information is helpful to any cracker
>on the system. I do firmly believe that restricting the information you
>give the user about your system will help security, but I also think it is
>a matter of diminishing returns and would rather the user who asked the
>question focus on the things I highlighted in my post yesterday (eg quoting
>issues, data validation, etc).
>
>If the SQL is exploitable, then mucking about with the fields whose values
>are obvious candidates for being sent to the database makes a difference.
>But further, it does make a difference to know about the field naming when
>it comes to extrapolating how to generate the rest of the query.
>
>Do you really think that this is inconceivable? The following URL is a
>well-written account of rain forest puppy hacking into a BBS forum software
>by exploiting it's error handling routines to gather some bits of
>information about how the queries are being created and exploiting that
>information through the CGI script.
>
>http://www.wiretrip.net/rfp/p/doc.asp?id=42&iface=2
>
>Since I read this article and then in reviewing the security of other CGI
>scripts, I have found exploitable SQL code in at least several places. I
>guarantee that bad SQL coding is a problem for sure in the latest CGI
>scripts.  But the degree varies from application to application.
>
>Just as seeing one cockroach in a kitchen actually entails a million more
>behind the walls, since reviewing CGI security is not a full time job for
>me (just an occasional if someone asks me), the fact I have seen this much
>exploitable code is an indicator to me that the problem is currently qu

  1   2   >