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? $dbh = DBI-connect(DBI:ODBC:$SERVER, $USER, $PASSWORD);
Perl Script for accessing XML file
Can anybody help me out in finding errors in the following code? I am not getting any output, when I am accessing the below asp page. Asp Page code: html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 meta http-equiv=Pragma content=no-cache meta name=vs_targetSchema content=http://schemas.microsoft.com/intellisense/ie5; /head body leftmargin=0 topmargin=0 scroll=no % $CCTVservice = $Server-CreateObject('MSXML2.DOMDocument.3.0'); $xml_file = Test.xml'; $node_name = 'to'; $CCTVservice-{async} = False; $CCTVservice-{validateOnParse} = False; $CCTVservice-Load($xml_file); $node_list = $CCTVservice-selectNodes($node_name); foreach $node (in $node_list) { print $node-{Text}, \n; } % /body /html XML File: ?xml version=1.0 ? note toTove/to fromJani/from headingReminder/HEADING bodyDon't forget me this weekend!/body /note Thanks Much, GP -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 31, 2004 11:32 AM To: Pothula, Giridhar; [EMAIL PROTECTED] Subject: RE: Perl Script for accessing XML file Pothula, Giridhar wrote: Hi. Top-post please. http://home.in.tum.de/~jain/software/outlook-quotefix/ Sorry...That was a typo. I would like to use PERL script to read the XML file (Text of the nodes). This is basically to customize the UI skins. All the skin values like color, images, font etc will be stored in an XML file. I would like to read from the XML file to generate the HTML code dynamically. OK, well the faq I pointed you to will give you some ideas of the overall topic of parsing XML with Perl. Lots of ways to approach it, so get an overview before diving in. -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 31, 2004 11:16 AM To: Pothula, Giridhar; [EMAIL PROTECTED] Subject: RE: Perl Script for accessing XML file Pothula, Giridhar wrote: Hi All, I am trying to get a code snippet for the client side Perl script in an ASP page which accesses XML file residing on the server. Hmm, not sure what you mean by client side. Both ASP and Perl are server-side technologies. Anyway, you might want to start at http://perl-xml.sourceforge.net/faq/
Re: ODBC
On Aug 31, 2004, at 4:15 PM, Rearick, Kenneth N. wrote: 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? $dbh = DBI-connect(DBI:ODBC:$SERVER, $USER, $PASSWORD); You can put catch errors like: use CGI::Carp qw(fatalsToBrowser); $dbh = DBI-connect(DBI:ODBC:$SERVER, $USER, $PASSWORD) || croak Database connection failed: $DBI::errstr; More generally, getting to know your server log is very important. I'm not sure where it is, but on *nix it is typically called error_log and is in the httpd directory (which could be in different places). 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: 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
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
RE: Which interface should I be using for Database Access?
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
Re: Which interface should I be using for Database Access?
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] http://learn.perl.org/ http://learn.perl.org/first-response
Loading an array
I need some help, I am running this code to load values into the $ArrayofCompareHex [$g] array. Currently it is not working. The $comparevalue gets the correct value but the value is not past into the array. Here is a portion of my code. Any ideas 230 my $g =0; 231 for ($g = 0; $g $mps; ++$g) { 239 $value = hex($ArrayofInput [$g]); 240 $ArrayofInputHex [$g] = $value; 241 $comparevalue = hex($ArrayofCompare [$g]); 242 $ArrayofCompareHex [$g] =$comparevalue; } thanks in advance
Re: Loading an array
I'm no expert, but if I were to do what it looks like you are trying to do, I would use the following code: my @ArrayofInputHex = map { hex($_) } @ArrayofInput; my @ArrayofCompareHex = map { hex($_) } @ArrayofCompare; One of the main benefits of this code is that when you use strict; like you should, you don't have to worry about local variables inside the loop. Hope this helps, David On Wed, 1 Sep 2004 12:46:57 -0700, Shawn Sharp [EMAIL PROTECTED] wrote: I need some help, I am running this code to load values into the $ArrayofCompareHex [$g] array. Currently it is not working. The $comparevalue gets the correct value but the value is not past into the array. Here is a portion of my code. Any ideas 230 my $g =0; 231 for ($g = 0; $g $mps; ++$g) { 239 $value = hex($ArrayofInput [$g]); 240 $ArrayofInputHex [$g] = $value; 241 $comparevalue = hex($ArrayofCompare [$g]); 242 $ArrayofCompareHex [$g] =$comparevalue; } thanks in advance -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Loading an array
Your question may be better asked on [EMAIL PROTECTED] since it isn't really CGI related. I need some help, I am running this code to load values into the $ArrayofCompareHex [$g] array. Currently it is not working. The $comparevalue gets the correct value but the value is not past into the array. Here is a portion of my code. Any ideas Do you have strict/warnings enabled? Where did $mps come from and what does it contain? http://danconia.org 230 my $g =0; 231 for ($g = 0; $g $mps; ++$g) { 239 $value = hex($ArrayofInput [$g]); 240 $ArrayofInputHex [$g] = $value; 241 $comparevalue = hex($ArrayofCompare [$g]); 242 $ArrayofCompareHex [$g] =$comparevalue; } thanks in advance -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Cookies v. Hiddent Fields
What is the difference (as far as security goes) between using a cookie and a hidden field? Are hidden fields cached if we are using SSL? I think not. If I use a GUID as a session ID in my database and store the GUID in a hidden field and the user sees the GUID in some GET parameters, is this of any consequence? Someone recommend that I don't persist cookies. How do I not persist cookies? Thanks, Siegfried
Re: Cookies v. Hiddent Fields
What is the difference (as far as security goes) between using a cookie and a hidden field? Are hidden fields cached if we are using SSL? I think not. None. Both are wide open. SSL simply encrypts the pipe between your server and the client (browser). Everything passing over it, including cookies and hidden fields, is encrypted, or not if SSL is not employed. I like the pipe analogy, think of everything that goes from the browser to the server (and since both cookies and hidden fields are client side until the client calls to the server) as traveling over a clear pipe. So if you can see into the pipe, then you can see everything. Then picture SSL as a wrapper around the pipe, it prevents you seeing *everything* traveling over the pipe, so then it is up to you to make sure the connections at either end work (aka browser supports SSL, server does too, and they have decided to use the covered pipe instead of the clear one). If I use a GUID as a session ID in my database and store the GUID in a hidden field and the user sees the GUID in some GET parameters, is this of any consequence? Depends on what the GUID is made of. Did my other write up of the authentication idiom not help? work? or the modules suggested by the other poster? Someone recommend that I don't persist cookies. How do I not persist cookies? They shouldn't persist by default, it is usually a question of how do I make them persist, whic his covered very clearly here: http://search.cpan.org/~lds/CGI.pm-3.05/CGI.pm#HTTP_COOKIES 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
Re: Cookies v. Hiddent Fields
From: Siegfried Heintze [EMAIL PROTECTED] What is the difference (as far as security goes) between using a cookie and a hidden field? Are hidden fields cached if we are using SSL? I think not. Both have the same security. A hidden field is simpler to be viewd by a user, but a cracker can see them both. If I use a GUID as a session ID in my database and store the GUID in a hidden field and the user sees the GUID in some GET parameters, is this of any consequence? No, no problem, but it depends how you define that hidden field. For exemple, don't use as hidden fields autoincreasing numbers but always use random strings. Someone recommend that I don't persist cookies. How do I not persist cookies? Don't put an expiration date and they will not be persistent. Teddy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response