Hi I would like to combine a webform where people can post comments with their name and also upload a file at the same time.
I cam up with this, but it deon't work:
form:
<form action="thanks.php" method="POST" class="style7">
<p>Name:
<input type="TEXT" name="name">
</p>
<p> Email:
<input type="TEXT" name="email">
</p>
<p>Comment:
<input type="text" name="email2" />
</p>
<p>comment</p>
<p>
<label>
<textarea name="ED" id="ED" cols="45" rows="5"></textarea>
</label>
</p>
<p>Comment</p>
<p>Upload</p>
<p><input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input name="Button" type="button" value="Upload File" />
</p>
<p>
<input type="SUBMIT" name="Submit" value="ok">
</p>
</form>
Thanks.php
<script language="php">
$email = $HTTP_POST_VARS;
$mailto = "myemail@gmail.com";
$mailsubj = "Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS)) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>
Can someone please help improve it so I can use it, thank you very much in advance.
Mok