I am working on a database for a client that uses PayPal as a shopping cart.
Here are the fieldnames from "default.cfg" and the sub html_record from "html.pl".
If I remove the portion enclosed by <!-- --> the I can select a record in the modify list and hit "modify records" and it will work, but if I remove the <!-- -->, I can't modify the record after selecting the radio button. Does this have to do with the hidden fields that are required by paypal? Do I need to add those fields to my database fields?
Below is the custom form (I have put the field names from my database in red so they are easy to see):
%db_def = (
Date => [0, 'date', 12, 15, 1, &get_date, ''],
Item => [1, 'alpha', 10, 255, 1, '', ''],
Category => [2, 'alpha', 0, 255, 1, '', ''],
Description => [3, 'alpha', '40x3', 500, 1, '', ''],
Sold => [4, 'alpha', 0, 3, 1, 'No', 'Yes|No'],
Size_L => [5, 'alpha', 12, 20, 1, '', ''],
Size_W => [6, 'alpha', 12, 20, 1, '', ''],
Price => [7, 'numer', 6, 255, 1, '', ''],
);
sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);
my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';
print qq|
<td width="100" align="right" valign="top" style="padding-top:5px"><a href="javascript:void(0)" onclick="javascript:window.open('../../images/$rec{'Category'}/images/$rec{'Item'}.jpg', '', 'width=500, height=500');"><img src="../../images/$rec{'Category'}/thumbnails/$rec{'Item'}.jpg" border="0" alt="$rec{'Item'}"></a></td>
<td align="center"><a href="javascript:void(0)" onclick="javascript:window.open('../../images/$rec{'Category'}/images/$rec{'Item'}.jpg', '', 'width=500, height=500');"><b>$rec{'Item'}</b></a><br />
$rec{'Description'}<br />
$rec{'Size_L'}" L by $rec{'Size_W'}" W<br />
<strong>$rec{'Price'}</strong>
<br /><br />
<!--
<table cellpadding="0" cellspacing="0" border="0">
<tr align="center" valign="top">
<td>
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/...tn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="test\@aol.com">
<input type="hidden" name="item_name" value="$rec{'Item'}">
<input type="hidden" name="amount" value="$rec{'Price'}">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form></td>
<td>
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="test\@aol.com">
<input type="image" src="https://www.paypal.com/...btn/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1">
</form></td>
</tr>
</table>
-->
</td>
|;
}
Here are the fieldnames from "default.cfg" and the sub html_record from "html.pl".
If I remove the portion enclosed by <!-- --> the I can select a record in the modify list and hit "modify records" and it will work, but if I remove the <!-- -->, I can't modify the record after selecting the radio button. Does this have to do with the hidden fields that are required by paypal? Do I need to add those fields to my database fields?
Below is the custom form (I have put the field names from my database in red so they are easy to see):
%db_def = (
Date => [0, 'date', 12, 15, 1, &get_date, ''],
Item => [1, 'alpha', 10, 255, 1, '', ''],
Category => [2, 'alpha', 0, 255, 1, '', ''],
Description => [3, 'alpha', '40x3', 500, 1, '', ''],
Sold => [4, 'alpha', 0, 3, 1, 'No', 'Yes|No'],
Size_L => [5, 'alpha', 12, 20, 1, '', ''],
Size_W => [6, 'alpha', 12, 20, 1, '', ''],
Price => [7, 'numer', 6, 255, 1, '', ''],
);
sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);
my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';
print qq|
<td width="100" align="right" valign="top" style="padding-top:5px"><a href="javascript:void(0)" onclick="javascript:window.open('../../images/$rec{'Category'}/images/$rec{'Item'}.jpg', '', 'width=500, height=500');"><img src="../../images/$rec{'Category'}/thumbnails/$rec{'Item'}.jpg" border="0" alt="$rec{'Item'}"></a></td>
<td align="center"><a href="javascript:void(0)" onclick="javascript:window.open('../../images/$rec{'Category'}/images/$rec{'Item'}.jpg', '', 'width=500, height=500');"><b>$rec{'Item'}</b></a><br />
$rec{'Description'}<br />
$rec{'Size_L'}" L by $rec{'Size_W'}" W<br />
<strong>$rec{'Price'}</strong>
<br /><br />
<!--
<table cellpadding="0" cellspacing="0" border="0">
<tr align="center" valign="top">
<td>
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/...tn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="test\@aol.com">
<input type="hidden" name="item_name" value="$rec{'Item'}">
<input type="hidden" name="amount" value="$rec{'Price'}">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form></td>
<td>
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="test\@aol.com">
<input type="image" src="https://www.paypal.com/...btn/view_cart_02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1">
</form></td>
</tr>
</table>
-->
</td>
|;
}