Forum Moderators: coopster

Message Too Old, No Replies

Image upload form

         

PeteM

8:57 pm on Jan 19, 2006 (gmt 0)

10+ Year Member



I have an image upload form like this.....


<form enctype="multipart/form-data" action="{U_CREATE_IMG}" method="post">
<tr>
<td align="center" class="row1"><span class="gen">
<br>{L_IMAGE_TYPES}
<br><br>
<input type="file" name="image" size="50" style="border: solid #000000 1px">
<br><br></span></td>
</tr>
<tr>
<td align="center" class="catBottom" >
<input type="submit" value="{L_UPLOAD_IMAGE}" class="mainoption" style="border: solid #000000 1px">
</td>
</tr>
</form>

How can I tell if the submit button has been depressed?

Thanks, Pete

coopster

1:44 am on Jan 20, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Typically you assign a name to the <input> element and check it:

<input name="mysubmitbutton" type="submit" value="{L_UPLOAD_IMAGE}" class="mainoption" style="border: solid #000000 1px">

In your script,you check to see if it exists (which usually means the user selected it):

if (isset(['mysubmitbutton'])) { 
// do something if the user clicked the submit button
}