我有一个表单,我想用一个提交按钮提交。
但是,我上传文件的操作与数据库发布的控制器不同。看起来像这样……
<form method="post" action="/admin/upholstery_product/add/">
<h3>Add a Product</h3>
Frame: <input type="text" name="productname" /><br>
Parent Category:
<select name="category">
<?php
foreach($cats AS $cat){
$sel = ($curCat->category_id == $cat->category_id) ? 'selected' : '';
echo "<option value='".$cat->category_id."' ".$sel.">" . $cat->category_name . "</option>\n";
}
?>
</select><br />
Family: <input type="text" name="family" /><br>
Width: <input type="text" name="width" size="6" /><br>
Height: <input type="text" name="height" size="6" /><br>
Depth: <input type="text" name="depth" size="6" /><br>
Seat Width: <input type="text" name="seat_width" size="6" /><br>
Seat Height: <input type="text" name="seat_height" size="6" /><br>
Seat Depth: <input type="text" name="seat_depth" size="6" /><br>
Arm Height: <input type ="text" name="arm_height" size="6" /><br>
Features: <textarea cols="40" rows="20" name="features"></textarea><br>
<form method="post" action="/upload/product_image_upload">
Image File: <input type="file" name="image" id="image"/><br>
</form>
<form method="post" action="/upload/product_image_upload">
Thumbnail File: <input type="file" name="thumbnail" id="thumbnail"/><br>
</form>
<form method="post" action="/upload/pdf_upload">
PDF File: <input type="file" name="pdf" id="pdf"/><br>
</form>
Status: <select name="status">
<option value="active">Active</option>
<option value="inactive">Inactive</option>
</select> <br>
<input type="submit" name="submit" value="Add Product" /><br>
</form>
有没有办法将文件操作发布到一个控制器并使用单个提交按钮提交到我的另一个控制器?现在代码不起作用。