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;
In reply to Getting a query string. by Eagle_f91
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |