Heres my script:
$entry{'searchbox'} = "+1";
open(FILE,"SparkPlugPrices.db");
@lines = <FILE>; close(FILE);
foreach $line (@lines) {
chomp($line);
($P,$D,$PR,$MU,$VatCode,$Weight) = split(/\|/,$line);
$LineCount++;
$PartNumber[$LineCount] = $P;
$PartDesc[$LineCount] = $D;
$Price[$LineCount] = ($PR * $MU / 100 + $PR);
$Price[$LineCount] = sprintf("%.2f\n", $Price[$LineCount]);
}
$entry{'searchbox'} =~ tr/a-z/A-Z/;
print "Content-type: text/html\n\n";
## Search Loop ##
if (($PartDesc[$lineNo] =~/$entry{'searchbox'}/) || ($PartNumber[$lineNo] =~ /$entry{'searchbox'}/)){
print <<EndOf;
<table border="0" cellpadding="2" cellspacing="2" style="border-collapse: collapse" bordercolor="#FFFFFF" width="850" id="AutoNumber4" bgcolor="#FFFFFF">
<tr class="initial" onMouseOver="this.className='highlight'" onMouseOut="this.className='normal'">
<td width="200" align="center" bordercolor="#000000"><font size="2">$PartNumber[$lineNo]</td>
<td width="450" align="center" bordercolor="#000000"><font size="2">$PartDesc[$lineNo]</td>
<td width="100" align="center" bordercolor="#000000"><font size="2">£$Price[$lineNo]</td>
<td width="100" align="center" bordercolor="#000000">
<form style="margin-bottom:0;" name="OrderLine$Result" method="POST" action=" <input type="hidden" name="Item" value="$PartNumber[$lineNo]">
<input type="text" name="qty" size="4" value="1" onkeyPress="return fnCheckNumeric();" onblur="this.value=removeSpaces(this.value); this.value=numbersOnly(this.value);"> <input type="submit" value="Add" name="Add">
</form>
</td>
</tr>
</table>
EndOf
}
}
Basically it works with $entry{'searchbox'}, only if it doesn't have a '+' sign in fron of it!
Any ideas?
$entry{'searchbox'} = "+1";
open(FILE,"SparkPlugPrices.db");
@lines = <FILE>; close(FILE);
foreach $line (@lines) {
chomp($line);
($P,$D,$PR,$MU,$VatCode,$Weight) = split(/\|/,$line);
$LineCount++;
$PartNumber[$LineCount] = $P;
$PartDesc[$LineCount] = $D;
$Price[$LineCount] = ($PR * $MU / 100 + $PR);
$Price[$LineCount] = sprintf("%.2f\n", $Price[$LineCount]);
}
$entry{'searchbox'} =~ tr/a-z/A-Z/;
print "Content-type: text/html\n\n";
## Search Loop ##
if (($PartDesc[$lineNo] =~/$entry{'searchbox'}/) || ($PartNumber[$lineNo] =~ /$entry{'searchbox'}/)){
print <<EndOf;
<table border="0" cellpadding="2" cellspacing="2" style="border-collapse: collapse" bordercolor="#FFFFFF" width="850" id="AutoNumber4" bgcolor="#FFFFFF">
<tr class="initial" onMouseOver="this.className='highlight'" onMouseOut="this.className='normal'">
<td width="200" align="center" bordercolor="#000000"><font size="2">$PartNumber[$lineNo]</td>
<td width="450" align="center" bordercolor="#000000"><font size="2">$PartDesc[$lineNo]</td>
<td width="100" align="center" bordercolor="#000000"><font size="2">£$Price[$lineNo]</td>
<td width="100" align="center" bordercolor="#000000">
<form style="margin-bottom:0;" name="OrderLine$Result" method="POST" action=" <input type="hidden" name="Item" value="$PartNumber[$lineNo]">
<input type="text" name="qty" size="4" value="1" onkeyPress="return fnCheckNumeric();" onblur="this.value=removeSpaces(this.value); this.value=numbersOnly(this.value);"> <input type="submit" value="Add" name="Add">
</form>
</td>
</tr>
</table>
EndOf
}
}
Basically it works with $entry{'searchbox'}, only if it doesn't have a '+' sign in fron of it!
Any ideas?