对此有些麻烦。我有一个数组正在输入我的表单数据 ro 电子邮件,但试图找到一种方法来组合一些复选框。对于“Grips”,如果选中,我希望列出一些复选框。以下是代码片段(这只是 PHP 的相关部分,表单邮件程序工作得很好,只是无法让所有复选框都发布):
$grind = join(", ", $_REQUEST["grind"]);
$fields = array();
$fields{"AccountName"} = "Accounts's Name: ";
$fields{"FitterName"} = "Fitter's Name: ";
$fields{"CustomerCat"} = "__CUSTOMER INFO___";
$fields{"CustomerName"} = "Customer's Name: ";
$fields{"CustomerPhone"} = "Customer's Phone: ";
$fields{"CustomerAddress"} = "Customer's Address: ";
$fields{"CustomerCity"} = "Customer's City: ";
$fields{"CustomerState"} = "Customer's State; ";
$fields{"CustomerZip"} = "Customer's Zip: ";
$fields{"WedgeType"} = "Wedge Loft: ";
$fields{"$grind"} = "Wedge Grind: " ;
$fields{"WedgesShaft"} = "Wedge Shaft: ";
这是HTML
<input type="checkbox" name="grind[V-Grind]" class="grinds" value="V-Grind">V-Grind
<input type="checkbox" name="grind[Tour Grind]" class="grinds" value="Tour Grind">Tour Grind
<input type="checkbox" name="grind[Heal Grind]" class="grinds" value="Heal Grind">Heal Grind
<input type="checkbox" name="grind[No Grind]" class="grinds"value="No Grind">No Grind
我知道这$fields{"$grind"} = "Wedge Grind: " ;
不是从 $grind 传递顶部数组的正确方法,但不确定什么是正确的方法,因为其他一切都很好。