Eagle_f91 has asked for the wisdom of the Perl Monks concerning the following question:
Update: Perl for ISAPI handels the header for me so I don't have to print it my self, I have other scripts written with out the print contect line using ISAPI working fine for displaying there data, and this script does print the line just not the query string.
I know what your thinking, getting a query string is easy. That is what I though, but it just is not working. Can someone look over this code and tell me what is wrong and why the query string is not being pulled?When i go to http://www.ffinfo.com/cgi-bin/navigation.plx?Quotes it does not print the query string.#!C:\Perl\bin\PerlEx30.dll -w use strict; use DBI; use CGI q~:standard~; use CGI::Carp qw(fatalsToBrowser); my ($DBH, $STH, $QueryString, @SQLResults, @Listing, $i, $MaxArray, $S +QLString); $i = 0; $QueryString = $ENV{'QUERY_STRING'}; print "$QueryString"; $DBH = DBI -> connect ('dbi:ODBC:SQLServer', '', '') or die "$DBI::err +str"; $STH = $DBH -> prepare (qq~select Name, Path from dbo.NavigationCatego +ries where Category = '$QueryString'~) or die "$DBI::errstr"; $STH -> execute or die "$DBI::errstr"; while (@SQLResults = $STH -> fetchrow_array) { $Listing[$i] = qq~<a href="http://www.ffinfo.com/$SQLResults[1]">$ +SQLResults[0]</a>~; $i++; } if ($i > 0) { $MaxArray = $i -1; $i = 0; while ($i < $MaxArray) { $Listing[$i] .= '<br />'; $i++; } print "@Listing"; } else { print "<!---->"; } $DBH -> disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting a query string.
by almut (Canon) on Oct 27, 2009 at 18:26 UTC | |
| |
|
Re: Getting a query string.
by marto (Cardinal) on Oct 27, 2009 at 18:29 UTC | |
by Eagle_f91 (Acolyte) on Oct 27, 2009 at 19:02 UTC | |
by gmargo (Hermit) on Oct 27, 2009 at 20:05 UTC | |
by Eagle_f91 (Acolyte) on Oct 27, 2009 at 20:52 UTC | |
|
Re: Getting a query string.
by Your Mother (Archbishop) on Oct 27, 2009 at 22:15 UTC | |
| |
|
Re: Getting a query string.
by gmargo (Hermit) on Oct 27, 2009 at 18:39 UTC | |
| |
|
Re: Getting a query string.
by Anonymous Monk on Oct 28, 2009 at 03:31 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |