Let's say I have two forms on the same page. The first form is for input of text data and the second for is for uploading an image.
1. I want the first form to record the input from the input fields to a mySQL table BEORE the action of the second form takes place.
2. Then I want to upload the image file (which has already been selected by the "Browse" button) without the user having to click on an "upload image" button. I need to force the "action" somehow after the action of the first form is complete.
Here are the 2 forms, each with different actions:
Code HTML4Strict:<form action="addItem.php" method="post"> <p>Item id: <input type="text" name="item_num" size="15" maxlength="20" value="<?php if (isset($_POST['item_num'])) echo $_POST['item_num']; ?>" /></p> <p>Item Name: <input type="text" name="item_name" size="15" maxlength="40" value="<?php if (isset($_POST['item_name'])) echo $_POST['item_name']; ?>" /></p> <p>Item Type: <input type="text" name="item_cat" size="20" maxlength="80" value="<?php if (isset($_POST['item_cat'])) echo $_POST['item_cat']; ?>" /> </p> <p>Item Description:<br/><textarea name="item_desc" id="textarea" cols="35" rows="5"></textarea> <p>Item Price: <input type="text" name="item_price" size="20" maxlength="80" value="<?php if (isset($_POST['item_price'])) echo $_POST['item_price']; ?>" /> </p> <br /> <br /> <label> <input name="onweb" type="checkbox" checked ="checked" /> show this item on the website</label> <br /> </p> <input type="hidden" name="submitted" value="TRUE" /> <p><input type="submit" name="submit" value="Post Item" /></p> <input type="hidden" name="submitted" value="TRUE" /> </form> <form action="processImage.php" enctype="multipart/form-data" method="post"> <tr> <td valign=top><strong>Image file:</strong></td> <td><input name="upfile" type="file" size="30"><br> Image files must be in JPEG, GIF, or PNG format. </td> </tr> <tr> <td colspan="2"><br/> <input type="submit" value="Upload Image"> </td> </tr> </form>
I hope this is stated clearly. Thanks again for any assistance.
Chop








Bookmarks