Phmailer file attachment options
Hi!
I use the Phmailer as an contact form, and I need the user to be able to choose how many attachment fields the user needs. Currently I have it set to 10 fields, but it looks a bit too much. And i really need like 10 or 15 fields. How do i create a drop down menu for the number of attachment fields that i want the customer to be able to choose from? / Frizzo from Sweden |
|
Im sorry, but i really don't know what to do with that. Do you care to explain? :-)
|
Sorry I misunderstood the question.
You'd do that in javascript. I will post an example in a minute. Code:
<script language="javascript"> <p>Attachments <input type="file" name="pictures[]" /> <div id="attachmentdiv"></div><input type="button" value="Add Another Attachment" id="addextraattach" /> <input type="submit" value="Send" /> </p> </form> |
Here we go:
Code:
<html> |
Oh sorry, I have not used scott's script for a while, here's what you do:
1. Go to line 577 of phMailer.php 2. Replace: Code:
<?For($i=1;$i <= $allowattach; $i++) {?> Code:
Code:
<script type="text/javascript"> Code:
<script type="text/javascript"> |
Thanks mate, I'm going to try it out and then I'll get back to you with the result! :)
F |
Thank you Atholon, it works like a charm. :)
|
No problem :)
Sorry I didn't understand it at first. |
Quote:
So, what should I do? :) /F |
change $allowattach="1"; to $allowattach = "10";
odd that it is a string but what the hay. |
1 Attachment(s)
Quote:
Here, take a look. The text is in Swedish but I tink you'll get the picture anyway. Edit: It says, when i have added 10 fields that "You can only add 10 files!", but it does not send the extra added nine attachments.. It's hard to explain.. |
I will have to look more into how he implements it in his script.
It should only have one "add another attachment" button if you used my code. |
Quote:
/F |
OK dude, it is because I made the input name attachments[] try attachment[] I have it updated in the above code.
I also fixed some styling issues, I never really tested it out but I just gave it a shot and it is working fine. You can change same var that scott added to change the number of files that can be attached. |
I thank you for your effort, but it still does not work. Looks (and works) exactly like before..
**** it, I'll get another form.. |
Try using my version and then just change it to what you want.
I will upload it in a second. |
Sure!
|
http://digitalhelpfiles.com/phMailer.zip
Scott, if you want to look this over and post it on your site that's cool. I just don't want you to get pissed off for me putting it on my server. If you're still having problems with that one I sent then you have something else messed up because I just tested it twice and it sent two attachments. |
It works fine now, I must have messed something up on my own.
Thanks! :) |
All times are GMT -5. The time now is 05:37 PM. |
Powered by vBulletin®