i'm trying to allow my users to upload images when they add a new product. my db has a table called postTable (post_id, post_title, product, post_date, user_id, image, image_type).
i have an insert form as follows:
Code: Select all
<form id="Upload" action="<?php echo $editFormAction ?>" enctype="multipart/form-data" method="post">
<h1>
Upload form
</h1>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size ?>">
<input name="post_id" type="hidden" id="post_id" />
<input name="user_id" type="hidden" id="user_id" value="<?php echo $row_rsgetUsername['user_id']; ?>" />
<input name="buy_or_share" type="hidden" id="buy_or_share" value="buy" />
<input name="post_date" type="hidden" id="post_date" value="NOW()" />
<p>
<label for="post_title">Posting Title:</label>
<input id="post_title" type="text" name="post_title">
</p>
<p>
<label for="product_name">Product/Store Name:</label>
<input id="product_name" type="text" name="product_name">
</p>
<p>
<label for="category_name">Category Name:</label>
<input id="category_name" type="text" name="category_name">
</p>
<p>
<label for="file">File to upload:</label>
<input id="image_data" type="file" name="image_data">
</p>
<p>
<label for="submit">Press to...</label>
<input id="submit" type="submit" name="submit" value="Upload me!">
</p>
</form>any recommendations would help, thank you for taking a look!